Skip to content

Commit a5891f4

Browse files
authored
Merge pull request #99 from nexB/v0.9.3_release
Operating system and python version are now required fields in CLI
2 parents 1d359cd + 4935a0b commit a5891f4

10 files changed

+498
-52
lines changed

CHANGELOG.rst

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ v0.9.3
66
------
77

88
- Add support for recursive requirements.
9+
- Add python 3.11 as a valid python version in choices.
10+
- Operating system and python version are now required fields in CLI.
11+
- Add dot versions (3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 2.7) with
12+
current python version choices for CLI (36, 37, 38, 39, 310, 311, 27).
913

1014

1115
v0.9.2

src/python_inspector/api.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
from python_inspector.resolution import get_requirements_from_python_manifest
4141
from python_inspector.utils_pypi import PLATFORMS_BY_OS
4242
from python_inspector.utils_pypi import PYPI_SIMPLE_URL
43-
from python_inspector.utils_pypi import PYTHON_DOT_VERSIONS_BY_VER
4443
from python_inspector.utils_pypi import Environment
44+
from python_inspector.utils_pypi import valid_python_versions
4545

4646

4747
class Resolution(NamedTuple):
@@ -103,9 +103,6 @@ def resolve_dependencies(
103103
f"Must be one of: {', '.join(PLATFORMS_BY_OS.keys())}"
104104
)
105105

106-
valid_python_versions = list(PYTHON_DOT_VERSIONS_BY_VER.keys())
107-
valid_python_versions.extend([dot_ver for pyver, dot_ver in PYTHON_DOT_VERSIONS_BY_VER.items()])
108-
109106
if not python_version:
110107
raise Exception(f"No python version provided.")
111108
if python_version not in valid_python_versions:

src/python_inspector/resolve_cli.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ def print_version(ctx, param, value):
7070
"-p",
7171
"--python-version",
7272
"python_version",
73-
type=click.Choice(utils_pypi.PYTHON_VERSIONS),
73+
type=click.Choice(utils_pypi.valid_python_versions),
7474
metavar="PYVER",
7575
show_default=True,
76+
required=True,
7677
help="Python version to use for dependency resolution.",
7778
)
7879
@click.option(
@@ -82,6 +83,7 @@ def print_version(ctx, param, value):
8283
type=click.Choice(utils_pypi.PLATFORMS_BY_OS),
8384
metavar="OS",
8485
show_default=True,
86+
required=True,
8587
help="OS to use for dependency resolution.",
8688
)
8789
@click.option(
@@ -195,8 +197,7 @@ def resolve_dependencies(
195197
SETUP-PY-FILE file and save the results as JSON to FILE.
196198
197199
Resolve the dependencies for the requested ``--python-version`` PYVER and
198-
``--operating_system`` OS combination defaulting Python version 3.8 and
199-
linux OS.
200+
``--operating_system`` OS combination.
200201
201202
Download from the provided PyPI simple --index-url INDEX(s) URLs defaulting
202203
to PyPI.org.

src/python_inspector/utils_pypi.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
TRACE_ULTRA_DEEP = False
9999

100100
# Supported environments
101-
PYTHON_VERSIONS = "36", "37", "38", "39", "310", "27"
101+
PYTHON_VERSIONS = "36", "37", "38", "39", "310", "311", "27"
102102

103103
PYTHON_DOT_VERSIONS_BY_VER = {
104104
"36": "3.6",
@@ -107,8 +107,12 @@
107107
"39": "3.9",
108108
"310": "3.10",
109109
"27": "2.7",
110+
"311": "3.11",
110111
}
111112

113+
valid_python_versions = list(PYTHON_DOT_VERSIONS_BY_VER.keys())
114+
valid_python_versions.extend([dot_ver for pyver, dot_ver in PYTHON_DOT_VERSIONS_BY_VER.items()])
115+
112116

113117
def get_python_dot_version(version):
114118
"""
@@ -123,6 +127,7 @@ def get_python_dot_version(version):
123127
"38": ["cp38", "cp38m", "abi3"],
124128
"39": ["cp39", "cp39m", "abi3"],
125129
"310": ["cp310", "cp310m", "abi3"],
130+
"311": ["cp311", "cp311m", "abi3"],
126131
"27": ["cp27", "cp27m"],
127132
}
128133

tests/data/frozen-requirements.txt-expected.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -6013,12 +6013,12 @@
60136013
"type": "pypi",
60146014
"namespace": null,
60156015
"name": "pip",
6016-
"version": "22.3",
6016+
"version": "22.3.1",
60176017
"qualifiers": {},
60186018
"subpath": null,
60196019
"primary_language": "Python",
60206020
"description": "The PyPA recommended tool for installing Python packages.\npip - The Python Package Installer\n==================================\n\n.. image:: https://img.shields.io/pypi/v/pip.svg\n :target: https://pypi.org/project/pip/\n\n.. image:: https://readthedocs.org/projects/pip/badge/?version=latest\n :target: https://pip.pypa.io/en/latest\n\npip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.\n\nPlease take a look at our documentation for how to install and use pip:\n\n* `Installation`_\n* `Usage`_\n\nWe release updates regularly, with a new version every 3 months. Find more details in our documentation:\n\n* `Release notes`_\n* `Release process`_\n\nIn pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.\n\n**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.\n\nIf you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:\n\n* `Issue tracking`_\n* `Discourse channel`_\n* `User IRC`_\n\nIf you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:\n\n* `GitHub page`_\n* `Development documentation`_\n* `Development IRC`_\n\nCode of Conduct\n---------------\n\nEveryone interacting in the pip project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.\n\n.. _package installer: https://packaging.python.org/guides/tool-recommendations/\n.. _Python Package Index: https://pypi.org\n.. _Installation: https://pip.pypa.io/en/stable/installation/\n.. _Usage: https://pip.pypa.io/en/stable/\n.. _Release notes: https://pip.pypa.io/en/stable/news.html\n.. _Release process: https://pip.pypa.io/en/latest/development/release-process/\n.. _GitHub page: https://github.com/pypa/pip\n.. _Development documentation: https://pip.pypa.io/en/latest/development\n.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html\n.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020\n.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html\n.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support\n.. _Issue tracking: https://github.com/pypa/pip/issues\n.. _Discourse channel: https://discuss.python.org/c/packaging\n.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa\n.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md",
6021-
"release_date": "2022-10-15T11:41:14",
6021+
"release_date": "2022-11-05T15:56:17",
60226022
"parties": [
60236023
{
60246024
"type": "person",
@@ -6044,11 +6044,11 @@
60446044
"Topic :: Software Development :: Build Tools"
60456045
],
60466046
"homepage_url": "https://pip.pypa.io/",
6047-
"download_url": "https://files.pythonhosted.org/packages/47/ef/8b5470b5b94b36231ed9c0bde90caa71c0d4322d4a15f009b2b7f4287fe0/pip-22.3-py3-none-any.whl",
6048-
"size": 2051507,
6047+
"download_url": "https://files.pythonhosted.org/packages/09/bd/2410905c76ee14c62baf69e3f4aa780226c1bbfc9485731ad018e35b0cb5/pip-22.3.1-py3-none-any.whl",
6048+
"size": 2051534,
60496049
"sha1": null,
6050-
"md5": "6123dc5fc3483ebb12becce7faa4cd28",
6051-
"sha256": "1daab4b8d3b97d1d763caeb01a4640a2250a0ea899e257b1e44b9eded91e15ab",
6050+
"md5": "74d0d338e0af6ca545d6ce7ef9734d75",
6051+
"sha256": "908c78e6bc29b676ede1c4d57981d490cb892eb45cd8c214ab6298125119e077",
60526052
"sha512": null,
60536053
"bug_tracking_url": null,
60546054
"code_view_url": "https://github.com/pypa/pip",
@@ -6068,20 +6068,20 @@
60686068
"dependencies": [],
60696069
"repository_homepage_url": null,
60706070
"repository_download_url": null,
6071-
"api_data_url": "https://pypi.org/pypi/pip/22.3/json",
6071+
"api_data_url": "https://pypi.org/pypi/pip/22.3.1/json",
60726072
"datasource_id": null,
6073-
"purl": "pkg:pypi/[email protected]"
6073+
"purl": "pkg:pypi/[email protected].1"
60746074
},
60756075
{
60766076
"type": "pypi",
60776077
"namespace": null,
60786078
"name": "pip",
6079-
"version": "22.3",
6079+
"version": "22.3.1",
60806080
"qualifiers": {},
60816081
"subpath": null,
60826082
"primary_language": "Python",
60836083
"description": "The PyPA recommended tool for installing Python packages.\npip - The Python Package Installer\n==================================\n\n.. image:: https://img.shields.io/pypi/v/pip.svg\n :target: https://pypi.org/project/pip/\n\n.. image:: https://readthedocs.org/projects/pip/badge/?version=latest\n :target: https://pip.pypa.io/en/latest\n\npip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.\n\nPlease take a look at our documentation for how to install and use pip:\n\n* `Installation`_\n* `Usage`_\n\nWe release updates regularly, with a new version every 3 months. Find more details in our documentation:\n\n* `Release notes`_\n* `Release process`_\n\nIn pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.\n\n**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.\n\nIf you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:\n\n* `Issue tracking`_\n* `Discourse channel`_\n* `User IRC`_\n\nIf you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:\n\n* `GitHub page`_\n* `Development documentation`_\n* `Development IRC`_\n\nCode of Conduct\n---------------\n\nEveryone interacting in the pip project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.\n\n.. _package installer: https://packaging.python.org/guides/tool-recommendations/\n.. _Python Package Index: https://pypi.org\n.. _Installation: https://pip.pypa.io/en/stable/installation/\n.. _Usage: https://pip.pypa.io/en/stable/\n.. _Release notes: https://pip.pypa.io/en/stable/news.html\n.. _Release process: https://pip.pypa.io/en/latest/development/release-process/\n.. _GitHub page: https://github.com/pypa/pip\n.. _Development documentation: https://pip.pypa.io/en/latest/development\n.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html\n.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020\n.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html\n.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support\n.. _Issue tracking: https://github.com/pypa/pip/issues\n.. _Discourse channel: https://discuss.python.org/c/packaging\n.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa\n.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md",
6084-
"release_date": "2022-10-15T11:41:17",
6084+
"release_date": "2022-11-05T15:56:20",
60856085
"parties": [
60866086
{
60876087
"type": "person",
@@ -6107,11 +6107,11 @@
61076107
"Topic :: Software Development :: Build Tools"
61086108
],
61096109
"homepage_url": "https://pip.pypa.io/",
6110-
"download_url": "https://files.pythonhosted.org/packages/f8/08/7f92782ff571c7c7cb6c5eeb8ebbb1f68cb02bdb24e55c5de4dd9ce98bc3/pip-22.3.tar.gz",
6111-
"size": 2077961,
6110+
"download_url": "https://files.pythonhosted.org/packages/a3/50/c4d2727b99052780aad92c7297465af5fe6eec2dbae490aa9763273ffdc1/pip-22.3.1.tar.gz",
6111+
"size": 2078129,
61126112
"sha1": null,
6113-
"md5": "f0dd02265e7ccd2f8758c840fba64810",
6114-
"sha256": "8182aec21dad6c0a49a2a3d121a87cd524b950e0b6092b181625f07ebdde7530",
6113+
"md5": "996f58a94fe0b8b82b6795c42bd171ba",
6114+
"sha256": "65fd48317359f3af8e593943e6ae1506b66325085ea64b706a998c6e83eeaf38",
61156115
"sha512": null,
61166116
"bug_tracking_url": null,
61176117
"code_view_url": "https://github.com/pypa/pip",
@@ -6131,9 +6131,9 @@
61316131
"dependencies": [],
61326132
"repository_homepage_url": null,
61336133
"repository_download_url": null,
6134-
"api_data_url": "https://pypi.org/pypi/pip/22.3/json",
6134+
"api_data_url": "https://pypi.org/pypi/pip/22.3.1/json",
61356135
"datasource_id": null,
6136-
"purl": "pkg:pypi/[email protected]"
6136+
"purl": "pkg:pypi/[email protected].1"
61376137
},
61386138
{
61396139
"type": "pypi",
@@ -10940,7 +10940,7 @@
1094010940
{
1094110941
"key": "pip",
1094210942
"package_name": "pip",
10943-
"installed_version": "22.3",
10943+
"installed_version": "22.3.1",
1094410944
"dependencies": []
1094510945
}
1094610946
]

0 commit comments

Comments
 (0)