Skip to content

Commit 1d359cd

Browse files
committed
Revert "Operating system and python version are now required fields in CLI"
This reverts commit b5f8cfa.
1 parent b5f8cfa commit 1d359cd

File tree

10 files changed

+50
-497
lines changed

10 files changed

+50
-497
lines changed

CHANGELOG.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ 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).
139

1410

1511
v0.9.2

src/python_inspector/api.py

Lines changed: 4 additions & 1 deletion
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
4344
from python_inspector.utils_pypi import Environment
44-
from python_inspector.utils_pypi import valid_python_versions
4545

4646

4747
class Resolution(NamedTuple):
@@ -103,6 +103,9 @@ 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+
106109
if not python_version:
107110
raise Exception(f"No python version provided.")
108111
if python_version not in valid_python_versions:

src/python_inspector/resolve_cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ def print_version(ctx, param, value):
7070
"-p",
7171
"--python-version",
7272
"python_version",
73-
type=click.Choice(utils_pypi.valid_python_versions),
73+
type=click.Choice(utils_pypi.PYTHON_VERSIONS),
7474
metavar="PYVER",
7575
show_default=True,
76-
required=True,
7776
help="Python version to use for dependency resolution.",
7877
)
7978
@click.option(
@@ -83,7 +82,6 @@ def print_version(ctx, param, value):
8382
type=click.Choice(utils_pypi.PLATFORMS_BY_OS),
8483
metavar="OS",
8584
show_default=True,
86-
required=True,
8785
help="OS to use for dependency resolution.",
8886
)
8987
@click.option(

src/python_inspector/utils_pypi.py

Lines changed: 1 addition & 6 deletions
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", "311", "27"
101+
PYTHON_VERSIONS = "36", "37", "38", "39", "310", "27"
102102

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

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-
116112

117113
def get_python_dot_version(version):
118114
"""
@@ -127,7 +123,6 @@ def get_python_dot_version(version):
127123
"38": ["cp38", "cp38m", "abi3"],
128124
"39": ["cp39", "cp39m", "abi3"],
129125
"310": ["cp310", "cp310m", "abi3"],
130-
"311": ["cp311", "cp311m", "abi3"],
131126
"27": ["cp27", "cp27m"],
132127
}
133128

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

Lines changed: 17 additions & 17 deletions
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.1",
6016+
"version": "22.3",
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-11-05T15:56:17",
6021+
"release_date": "2022-10-15T11:41:14",
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/09/bd/2410905c76ee14c62baf69e3f4aa780226c1bbfc9485731ad018e35b0cb5/pip-22.3.1-py3-none-any.whl",
6048-
"size": 2051534,
6047+
"download_url": "https://files.pythonhosted.org/packages/47/ef/8b5470b5b94b36231ed9c0bde90caa71c0d4322d4a15f009b2b7f4287fe0/pip-22.3-py3-none-any.whl",
6048+
"size": 2051507,
60496049
"sha1": null,
6050-
"md5": "74d0d338e0af6ca545d6ce7ef9734d75",
6051-
"sha256": "908c78e6bc29b676ede1c4d57981d490cb892eb45cd8c214ab6298125119e077",
6050+
"md5": "6123dc5fc3483ebb12becce7faa4cd28",
6051+
"sha256": "1daab4b8d3b97d1d763caeb01a4640a2250a0ea899e257b1e44b9eded91e15ab",
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.1/json",
6071+
"api_data_url": "https://pypi.org/pypi/pip/22.3/json",
60726072
"datasource_id": null,
6073-
"purl": "pkg:pypi/pip@22.3.1"
6073+
"purl": "pkg:pypi/pip@22.3"
60746074
},
60756075
{
60766076
"type": "pypi",
60776077
"namespace": null,
60786078
"name": "pip",
6079-
"version": "22.3.1",
6079+
"version": "22.3",
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-11-05T15:56:20",
6084+
"release_date": "2022-10-15T11:41:17",
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/a3/50/c4d2727b99052780aad92c7297465af5fe6eec2dbae490aa9763273ffdc1/pip-22.3.1.tar.gz",
6111-
"size": 2078129,
6110+
"download_url": "https://files.pythonhosted.org/packages/f8/08/7f92782ff571c7c7cb6c5eeb8ebbb1f68cb02bdb24e55c5de4dd9ce98bc3/pip-22.3.tar.gz",
6111+
"size": 2077961,
61126112
"sha1": null,
6113-
"md5": "996f58a94fe0b8b82b6795c42bd171ba",
6114-
"sha256": "65fd48317359f3af8e593943e6ae1506b66325085ea64b706a998c6e83eeaf38",
6113+
"md5": "f0dd02265e7ccd2f8758c840fba64810",
6114+
"sha256": "8182aec21dad6c0a49a2a3d121a87cd524b950e0b6092b181625f07ebdde7530",
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.1/json",
6134+
"api_data_url": "https://pypi.org/pypi/pip/22.3/json",
61356135
"datasource_id": null,
6136-
"purl": "pkg:pypi/pip@22.3.1"
6136+
"purl": "pkg:pypi/pip@22.3"
61376137
},
61386138
{
61396139
"type": "pypi",
@@ -10940,7 +10940,7 @@
1094010940
{
1094110941
"key": "pip",
1094210942
"package_name": "pip",
10943-
"installed_version": "22.3.1",
10943+
"installed_version": "22.3",
1094410944
"dependencies": []
1094510945
}
1094610946
]

0 commit comments

Comments
 (0)