diff --git a/.coveragerc b/.coveragerc index da205e5a..08a04d6a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] branch = True -omit = packaging/_compat.py +omit = packaging2/_compat.py [report] exclude_lines = diff --git a/.gitignore b/.gitignore index 05e554a6..b96950ae 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ _build/ build/ dist/ htmlcov/ +/.python-version +/venv/ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f23c3031..5f81d06b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,12 +1,19 @@ Changelog --------- +21.4 - 2022-12-22 +~~~~~~~~~~~~~~~~~ + +* Fork of v21.3 to packaging2 as a workaround of https://github.com/pypa/packaging/issues/530 + and reinstate support for LegacyVersion and LegacySpecifier + + 21.3 - 2021-11-17 ~~~~~~~~~~~~~~~~~ -* Add a ``pp3-none-any`` tag (:issue:`311`) -* Replace the blank pyparsing 3 exclusion with a 3.0.5 exclusion (:issue:`481`, :issue:`486`) -* Fix a spelling mistake (:issue:`479`) +* Add a ``pp3-none-any`` tag (`#311 `__) +* Replace the blank pyparsing 3 exclusion with a 3.0.5 exclusion (`#481 `__, `#486 `__) +* Fix a spelling mistake (`#479 `__) 21.2 - 2021-10-29 ~~~~~~~~~~~~~~~~~ @@ -21,33 +28,33 @@ Changelog 21.0 - 2021-07-03 ~~~~~~~~~~~~~~~~~ -* PEP 656: musllinux support (:issue:`411`) +* PEP 656: musllinux support (`#411 `__) * Drop support for Python 2.7, Python 3.4 and Python 3.5. -* Replace distutils usage with sysconfig (:issue:`396`) -* Add support for zip files in ``parse_sdist_filename`` (:issue:`429`) -* Use cached ``_hash`` attribute to short-circuit tag equality comparisons (:issue:`417`) -* Specify the default value for the ``specifier`` argument to ``SpecifierSet`` (:issue:`437`) -* Proper keyword-only "warn" argument in packaging.tags (:issue:`403`) -* Correctly remove prerelease suffixes from ~= check (:issue:`366`) -* Fix type hints for ``Version.post`` and ``Version.dev`` (:issue:`393`) -* Use typing alias ``UnparsedVersion`` (:issue:`398`) -* Improve type inference for ``packaging.specifiers.filter()`` (:issue:`430`) -* Tighten the return type of ``canonicalize_version()`` (:issue:`402`) +* Replace distutils usage with sysconfig (`#396 `__) +* Add support for zip files in ``parse_sdist_filename`` (`#429 `__) +* Use cached ``_hash`` attribute to short-circuit tag equality comparisons (`#417 `__) +* Specify the default value for the ``specifier`` argument to ``SpecifierSet`` (`#437 `__) +* Proper keyword-only "warn" argument in packaging.tags (`#403 `__) +* Correctly remove prerelease suffixes from ~= check (`#366 `__) +* Fix type hints for ``Version.post`` and ``Version.dev`` (`#393 `__) +* Use typing alias ``UnparsedVersion`` (`#398 `__) +* Improve type inference for ``packaging.specifiers.filter()`` (`#430 `__) +* Tighten the return type of ``canonicalize_version()`` (`#402 `__) 20.9 - 2021-01-29 ~~~~~~~~~~~~~~~~~ -* Run `isort `_ over the code base (:issue:`377`) -* Add support for the ``macosx_10_*_universal2`` platform tags (:issue:`379`) +* Run `isort `_ over the code base (`#377 `__) +* Add support for the ``macosx_10_*_universal2`` platform tags (`#379 `__) * Introduce ``packaging.utils.parse_wheel_filename()`` and ``parse_sdist_filename()`` - (:issue:`387` and :issue:`389`) + (`#387 `__ and `#389 `__) 20.8 - 2020-12-11 ~~~~~~~~~~~~~~~~~ -* Revert back to setuptools for compatibility purposes for some Linux distros (:issue:`363`) +* Revert back to setuptools for compatibility purposes for some Linux distros (`#363 `__) * Do not insert an underscore in wheel tags when the interpreter version number - is more than 2 digits (:issue:`372`) + is more than 2 digits (`#372 `__) 20.7 - 2020-11-28 ~~~~~~~~~~~~~~~~~ @@ -59,22 +66,22 @@ No unreleased changes. .. note:: This release was subsequently yanked, and these changes were included in 20.7. -* Fix flit configuration, to include LICENSE files (:issue:`357`) -* Make `intel` a recognized CPU architecture for the `universal` macOS platform tag (:issue:`361`) +* Fix flit configuration, to include LICENSE files (`#357 `__) +* Make `intel` a recognized CPU architecture for the `universal` macOS platform tag (`#361 `__) * Add some missing type hints to `packaging.requirements` (issue:`350`) 20.5 - 2020-11-27 ~~~~~~~~~~~~~~~~~ -* Officially support Python 3.9 (:issue:`343`) -* Deprecate the ``LegacyVersion`` and ``LegacySpecifier`` classes (:issue:`321`) +* Officially support Python 3.9 (`#343 `__) +* Deprecate the ``LegacyVersion`` and ``LegacySpecifier`` classes (`#321 `__) * Handle ``OSError`` on non-dynamic executables when attempting to resolve the glibc version string. 20.4 - 2020-05-19 ~~~~~~~~~~~~~~~~~ -* Canonicalize version before comparing specifiers. (:issue:`282`) +* Canonicalize version before comparing specifiers. (`#282 `__) * Change type hint for ``canonicalize_name`` to return ``packaging.utils.NormalizedName``. This enables the use of static typing tools (like mypy) to detect mixing of @@ -94,48 +101,48 @@ No unreleased changes. 20.1 - 2020-01-24 ~~~~~~~~~~~~~~~~~~~ -* Fix a bug caused by reuse of an exhausted iterator. (:issue:`257`) +* Fix a bug caused by reuse of an exhausted iterator. (`#257 `__) 20.0 - 2020-01-06 ~~~~~~~~~~~~~~~~~ -* Add type hints (:issue:`191`) +* Add type hints (`#191 `__) -* Add proper trove classifiers for PyPy support (:issue:`198`) +* Add proper trove classifiers for PyPy support (`#198 `__) -* Scale back depending on ``ctypes`` for manylinux support detection (:issue:`171`) +* Scale back depending on ``ctypes`` for manylinux support detection (`#171 `__) -* Use ``sys.implementation.name`` where appropriate for ``packaging.tags`` (:issue:`193`) +* Use ``sys.implementation.name`` where appropriate for ``packaging.tags`` (`#193 `__) -* Expand upon the API provided by ``packaging.tags``: ``interpreter_name()``, ``mac_platforms()``, ``compatible_tags()``, ``cpython_tags()``, ``generic_tags()`` (:issue:`187`) +* Expand upon the API provided by ``packaging.tags``: ``interpreter_name()``, ``mac_platforms()``, ``compatible_tags()``, ``cpython_tags()``, ``generic_tags()`` (`#187 `__) -* Officially support Python 3.8 (:issue:`232`) +* Officially support Python 3.8 (`#232 `__) -* Add ``major``, ``minor``, and ``micro`` aliases to ``packaging.version.Version`` (:issue:`226`) +* Add ``major``, ``minor``, and ``micro`` aliases to ``packaging.version.Version`` (`#226 `__) -* Properly mark ``packaging`` has being fully typed by adding a `py.typed` file (:issue:`226`) +* Properly mark ``packaging`` has being fully typed by adding a `py.typed` file (`#226 `__) 19.2 - 2019-09-18 ~~~~~~~~~~~~~~~~~ -* Remove dependency on ``attrs`` (:issue:`178`, :issue:`179`) +* Remove dependency on ``attrs`` (`#178 `__, `#179 `__) -* Use appropriate fallbacks for CPython ABI tag (:issue:`181`, :issue:`185`) +* Use appropriate fallbacks for CPython ABI tag (`#181 `__, `#185 `__) -* Add manylinux2014 support (:issue:`186`) +* Add manylinux2014 support (`#186 `__) -* Improve ABI detection (:issue:`181`) +* Improve ABI detection (`#181 `__) -* Properly handle debug wheels for Python 3.8 (:issue:`172`) +* Properly handle debug wheels for Python 3.8 (`#172 `__) -* Improve detection of debug builds on Windows (:issue:`194`) +* Improve detection of debug builds on Windows (`#194 `__) 19.1 - 2019-07-30 ~~~~~~~~~~~~~~~~~ -* Add the ``packaging.tags`` module. (:issue:`156`) +* Add the ``packaging.tags`` module. (`#156 `__) -* Correctly handle two-digit versions in ``python_version`` (:issue:`119`) +* Correctly handle two-digit versions in ``python_version`` (`#119 `__) 19.0 - 2019-01-20 @@ -155,7 +162,7 @@ No unreleased changes. 18.0 - 2018-09-26 ~~~~~~~~~~~~~~~~~ -* Improve error messages when invalid requirements are given. (:issue:`129`) +* Improve error messages when invalid requirements are given. (`#129 `__) 17.1 - 2017-02-28 @@ -169,16 +176,16 @@ No unreleased changes. * Drop support for python 2.6, 3.2, and 3.3. -* Define minimal pyparsing version to 2.0.2 (:issue:`91`). +* Define minimal pyparsing version to 2.0.2 (`#91 `__). * Add ``epoch``, ``release``, ``pre``, ``dev``, and ``post`` attributes to - ``Version`` and ``LegacyVersion`` (:issue:`34`). + ``Version`` and ``LegacyVersion`` (`#34 `__). * Add ``Version().is_devrelease`` and ``LegacyVersion().is_devrelease`` to make it easy to determine if a release is a development release. * Add ``utils.canonicalize_version`` to canonicalize version strings or - ``Version`` instances (:issue:`121`). + ``Version`` instances (`#121 `__). 16.8 - 2016-10-29 @@ -244,7 +251,7 @@ No unreleased changes. * Support installation of packaging when only distutils is available. * Fix ``==`` comparison when there is a prefix and a local version in play. - (:issue:`41`). + (`#41 `__). * Implement environment markers from PEP 508. @@ -252,7 +259,7 @@ No unreleased changes. 15.3 - 2015-08-01 ~~~~~~~~~~~~~~~~~ -* Normalize post-release spellings for rev/r prefixes. :issue:`35` +* Normalize post-release spellings for rev/r prefixes. `#35 `__ 15.2 - 2015-05-13 diff --git a/README.rst b/README.rst index e8bebe74..a5a63f83 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,12 @@ -packaging -========= +packaging2 +========== .. start-intro +packaging2 is friendly fork of packaging to work around the drop for +LegacyVersion support. See https://github.com/pypa/packaging/issues/530 + + Reusable core utilities for various Python Packaging `interoperability specifications `_. @@ -12,7 +16,7 @@ or benefit greatly from having a single shared implementation (eg: :pep:`425`). .. end-intro -The ``packaging`` project includes the following: version handling, specifiers, +The ``packaging2`` project includes the following: version handling, specifiers, markers, requirements, tags, utilities. Documentation @@ -32,18 +36,15 @@ Installation Use ``pip`` to install these utilities:: - pip install packaging + pip install packaging2 Discussion ---------- If you run into bugs, you can file them in our `issue tracker`_. -You can also join ``#pypa`` on Freenode to ask questions or get involved. - -.. _`documentation`: https://packaging.pypa.io/ -.. _`issue tracker`: https://github.com/pypa/packaging/issues +.. _`issue tracker`: https://github.com/nexB/packaging2/issues Code of Conduct @@ -61,13 +62,9 @@ The ``CONTRIBUTING.rst`` file outlines how to contribute to this project as well as how to report a potential security issue. The documentation for this project also covers information about `project development`_ and `security`_. -.. _`project development`: https://packaging.pypa.io/en/latest/development/ -.. _`security`: https://packaging.pypa.io/en/latest/security/ Project History --------------- Please review the ``CHANGELOG.rst`` file or the `Changelog documentation`_ for recent changes and project history. - -.. _`Changelog documentation`: https://packaging.pypa.io/en/latest/changelog/ diff --git a/docs/conf.py b/docs/conf.py index edd8dd5c..d8e784e1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,7 @@ base_dir = os.path.join(os.path.dirname(__file__), os.pardir) about = {} -with open(os.path.join(base_dir, "packaging", "__about__.py")) as f: +with open(os.path.join(base_dir, "packaging2", "__about__.py")) as f: exec(f.read(), about) version = release = about["__version__"] @@ -52,8 +52,8 @@ exclude_patterns = ["_build"] extlinks = { - "issue": ("https://github.com/pypa/packaging/issues/%s", "#"), - "pull": ("https://github.com/pypa/packaging/pull/%s", "PR #"), + "issue": ("https://github.com/nexb/packaging2/issues/%s", "#"), + "pull": ("https://github.com/nexb/packaging2/pull/%s", "PR #"), } # -- Options for HTML output -------------------------------------------------- @@ -61,7 +61,7 @@ # a list of builtin themes. html_theme = "furo" -html_title = "packaging" +html_title = "packaging2" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -76,17 +76,12 @@ latex_elements = {} -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]) -latex_documents = [ - ("index", "packaging.tex", "Packaging Documentation", "Donald Stufft", "manual") -] # -- Options for manual page output ------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "packaging", "Packaging Documentation", ["Donald Stufft"], 1)] +man_pages = [("index", "packaging2", "Packaging2 Documentation", ["Donald Stufft"], 1)] # -- Options for Texinfo output ----------------------------------------------- @@ -96,10 +91,10 @@ texinfo_documents = [ ( "index", - "packaging", - "Packaging Documentation", + "packaging2", + "Packaging2 Documentation", "Donald Stufft", - "packaging", + "packaging2", "Core utilities for Python packages", "Miscellaneous", ) diff --git a/docs/index.rst b/docs/index.rst index aafdae83..fab77423 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ -Welcome to packaging -==================== +Welcome to packaging2 +===================== .. include:: ../README.rst :start-after: start-intro @@ -9,11 +9,11 @@ Welcome to packaging Installation ------------ -You can install packaging with ``pip``: +You can install packaging2 with ``pip``: .. code-block:: console - $ pip install packaging + $ pip install packaging2 .. toctree:: diff --git a/docs/markers.rst b/docs/markers.rst index ad253616..68a510a6 100644 --- a/docs/markers.rst +++ b/docs/markers.rst @@ -1,7 +1,7 @@ Markers ======= -.. currentmodule:: packaging.markers +.. currentmodule:: packaging2.markers One extra requirement of dealing with dependencies is the ability to specify if it is required depending on the operating system or Python version in use. @@ -12,7 +12,7 @@ Usage .. doctest:: - >>> from packaging.markers import Marker, UndefinedEnvironmentName + >>> from packaging2.markers import Marker, UndefinedEnvironmentName >>> marker = Marker("python_version>'2'") >>> marker "2"')> diff --git a/docs/requirements.rst b/docs/requirements.rst index e7c5a85a..c6e3e7c5 100644 --- a/docs/requirements.rst +++ b/docs/requirements.rst @@ -1,7 +1,7 @@ Requirements ============ -.. currentmodule:: packaging.requirements +.. currentmodule:: packaging2.requirements Parse a given requirements line for specifying dependencies of a Python project, using `PEP 508`_ which defines the scheme that has been implemented @@ -12,7 +12,7 @@ Usage .. doctest:: - >>> from packaging.requirements import Requirement + >>> from packaging2.requirements import Requirement >>> simple_req = Requirement("name") >>> simple_req diff --git a/docs/security.rst b/docs/security.rst index f7fdb000..806dd444 100644 --- a/docs/security.rst +++ b/docs/security.rst @@ -1,7 +1,7 @@ Security ======== -We take the security of packaging seriously. If you believe you've identified a +We take the security of packaging2 seriously. If you believe you've identified a security issue in it, DO NOT report the issue in any public forum, including (but not limited to): diff --git a/docs/specifiers.rst b/docs/specifiers.rst index 83299a8a..78ba160a 100644 --- a/docs/specifiers.rst +++ b/docs/specifiers.rst @@ -1,7 +1,7 @@ Specifiers ========== -.. currentmodule:: packaging.specifiers +.. currentmodule:: packaging2.specifiers A core requirement of dealing with dependencies is the ability to specify what versions of a dependency are acceptable for you. `PEP 440`_ defines the @@ -12,8 +12,8 @@ Usage .. doctest:: - >>> from packaging.specifiers import SpecifierSet - >>> from packaging.version import Version + >>> from packaging2.specifiers import SpecifierSet + >>> from packaging2.version import Version >>> spec1 = SpecifierSet("~=1.0") >>> spec1 diff --git a/docs/tags.rst b/docs/tags.rst index ecd613b5..7bc3ee0b 100644 --- a/docs/tags.rst +++ b/docs/tags.rst @@ -1,7 +1,7 @@ Tags ==== -.. currentmodule:: packaging.tags +.. currentmodule:: packaging2.tags Wheels encode the Python interpreter, ABI, and platform that they support in their filenames using `platform compatibility tags`_. This module provides @@ -13,7 +13,7 @@ Usage .. doctest:: - >>> from packaging.tags import Tag, sys_tags + >>> from packaging2.tags import Tag, sys_tags >>> import sys >>> looking_for = Tag("py{major}".format(major=sys.version_info.major), "none", "any") >>> supported_tags = list(sys_tags()) diff --git a/docs/utils.rst b/docs/utils.rst index 8fbb0250..0aa54663 100644 --- a/docs/utils.rst +++ b/docs/utils.rst @@ -1,7 +1,7 @@ Utilities ========= -.. currentmodule:: packaging.utils +.. currentmodule:: packaging2.utils A set of small, helper utilities for dealing with Python packages. @@ -19,7 +19,7 @@ Reference .. doctest:: - >>> from packaging.utils import canonicalize_name + >>> from packaging2.utils import canonicalize_name >>> canonicalize_name("Django") 'django' >>> canonicalize_name("oslo.concurrency") @@ -30,14 +30,14 @@ Reference .. function:: canonicalize_version(version) This function takes a string representing a package version (or a - :class:`~packaging.version.Version` instance), and returns the + :class:`~packaging2.version.Version` instance), and returns the normalized form of it. :param str version: The version to normalize. .. doctest:: - >>> from packaging.utils import canonicalize_version + >>> from packaging2.utils import canonicalize_version >>> canonicalize_version('1.4.0.0.0') '1.4' @@ -47,7 +47,7 @@ Reference returning a tuple of name, version, build number, and tags. The name part of the tuple is normalized. The version portion is an - instance of :class:`~packaging.version.Version`. The build number + instance of :class:`~packaging2.version.Version`. The build number is ``()`` if there is no build number in the wheel filename, otherwise a two-item tuple of an integer for the leading digits and a string for the rest of the build number. The tags portion is an @@ -57,9 +57,9 @@ Reference .. doctest:: - >>> from packaging.utils import parse_wheel_filename - >>> from packaging.tags import Tag - >>> from packaging.version import Version + >>> from packaging2.utils import parse_wheel_filename + >>> from packaging2.tags import Tag + >>> from packaging2.version import Version >>> name, ver, build, tags = parse_wheel_filename("foo-1.0-py3-none-any.whl") >>> name 'foo' @@ -75,14 +75,14 @@ Reference This function takes the filename of a sdist file (as specified in the `Source distribution format`_ documentation), and parses it, returning a tuple of the normalized name and version as - represented by an instance of :class:`~packaging.version.Version`. + represented by an instance of :class:`~packaging2.version.Version`. :param str filename: The name of the sdist file. .. doctest:: - >>> from packaging.utils import parse_sdist_filename - >>> from packaging.version import Version + >>> from packaging2.utils import parse_sdist_filename + >>> from packaging2.version import Version >>> name, ver = parse_sdist_filename("foo-1.0.tar.gz") >>> name 'foo' diff --git a/docs/version.rst b/docs/version.rst index a43cf786..935e8425 100644 --- a/docs/version.rst +++ b/docs/version.rst @@ -1,7 +1,7 @@ Version Handling ================ -.. currentmodule:: packaging.version +.. currentmodule:: packaging2.version A core requirement of dealing with packages is the ability to work with versions. `PEP 440`_ defines the standard version scheme for Python packages @@ -12,7 +12,7 @@ Usage .. doctest:: - >>> from packaging.version import Version, parse + >>> from packaging2.version import Version, parse >>> v1 = parse("1.0a5") >>> v2 = Version("1.0") >>> v1 @@ -159,7 +159,7 @@ Reference :class:`LegacyVersion` instances are always ordered lower than :class:`Version` instances. - >>> from packaging.version import Version, LegacyVersion + >>> from packaging2.version import Version, LegacyVersion >>> v1 = Version("1.0") >>> v2 = LegacyVersion("1.0") >>> v1 > v2 @@ -172,7 +172,7 @@ Reference other versions that are not (:class:`LegacyVersion`). Examples include versions with `Pre-release spelling`_ and `Post-release spelling`_. - >>> from packaging.version import parse + >>> from packaging2.version import parse >>> v1 = parse('0.9.8a') >>> v2 = parse('0.9.8beta') >>> v3 = parse('0.9.8r') diff --git a/noxfile.py b/noxfile.py index 10564101..547b4cb2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -34,7 +34,7 @@ def coverage(*args): coverage( "run", "--source", - "packaging/", + "packaging2/", "-m", "pytest", "--strict-markers", @@ -93,7 +93,7 @@ def docs(session): @nox.session def release(session): - package_name = "packaging" + package_name = "packaging2" version_file = Path(f"{package_name}/__about__.py") changelog_file = Path("CHANGELOG.rst") @@ -167,7 +167,7 @@ def release(session): session.run("twine", "upload", *files) # Open up the GitHub release page. - webbrowser.open("https://github.com/pypa/packaging/releases") + webbrowser.open("https://github.com/nexb/packaging2/releases") # ----------------------------------------------------------------------------- @@ -210,8 +210,8 @@ def _check_git_state(session, version_tag): """Check state of the git repository, prior to making the release.""" # Ensure the upstream remote pushes to the correct URL. allowed_upstreams = [ - "git@github.com:pypa/packaging.git", - "https://github.com/pypa/packaging.git", + "git@github.com:nexb/packaging2.git", + "https://github.com/nexb/packaging2.git", ] result = subprocess.run( ["git", "remote", "get-url", "--push", "upstream"], diff --git a/packaging/__about__.py b/packaging2/__about__.py similarity index 74% rename from packaging/__about__.py rename to packaging2/__about__.py index 3551bc2d..0c8c72e7 100644 --- a/packaging/__about__.py +++ b/packaging2/__about__.py @@ -13,11 +13,11 @@ "__copyright__", ] -__title__ = "packaging" -__summary__ = "Core utilities for Python packages" -__uri__ = "https://github.com/pypa/packaging" +__title__ = "packaging2" +__summary__ = "Core utilities for Python packages. Fork to support LegacyVersion" +__uri__ = "https://github.com/nexB/packaging2" -__version__ = "21.3" +__version__ = "21.4" __author__ = "Donald Stufft and individual contributors" __email__ = "donald@stufft.io" diff --git a/packaging/__init__.py b/packaging2/__init__.py similarity index 100% rename from packaging/__init__.py rename to packaging2/__init__.py diff --git a/packaging/_manylinux.py b/packaging2/_manylinux.py similarity index 100% rename from packaging/_manylinux.py rename to packaging2/_manylinux.py diff --git a/packaging/_musllinux.py b/packaging2/_musllinux.py similarity index 100% rename from packaging/_musllinux.py rename to packaging2/_musllinux.py diff --git a/packaging/_structures.py b/packaging2/_structures.py similarity index 100% rename from packaging/_structures.py rename to packaging2/_structures.py diff --git a/packaging/markers.py b/packaging2/markers.py similarity index 100% rename from packaging/markers.py rename to packaging2/markers.py diff --git a/packaging/py.typed b/packaging2/py.typed similarity index 100% rename from packaging/py.typed rename to packaging2/py.typed diff --git a/packaging/requirements.py b/packaging2/requirements.py similarity index 100% rename from packaging/requirements.py rename to packaging2/requirements.py diff --git a/packaging/specifiers.py b/packaging2/specifiers.py similarity index 100% rename from packaging/specifiers.py rename to packaging2/specifiers.py diff --git a/packaging/tags.py b/packaging2/tags.py similarity index 100% rename from packaging/tags.py rename to packaging2/tags.py diff --git a/packaging/utils.py b/packaging2/utils.py similarity index 100% rename from packaging/utils.py rename to packaging2/utils.py diff --git a/packaging/version.py b/packaging2/version.py similarity index 100% rename from packaging/version.py rename to packaging2/version.py diff --git a/setup.py b/setup.py index ba1023f5..768948cd 100644 --- a/setup.py +++ b/setup.py @@ -21,22 +21,16 @@ base_dir = os.path.dirname(__file__) about = {} -with open(os.path.join(base_dir, "packaging", "__about__.py")) as f: +with open(os.path.join(base_dir, "packaging2", "__about__.py")) as f: exec(f.read(), about) with open(os.path.join(base_dir, "README.rst")) as f: long_description = f.read() with open(os.path.join(base_dir, "CHANGELOG.rst")) as f: - # Remove :issue:`ddd` tags that breaks the description rendering - changelog = re.sub( - r":issue:`(\d+)`", - r"`#\1 `__", - f.read(), - ) + changelog = f.read() long_description = "\n".join([long_description, changelog]) - setup( name=about["__title__"], version=about["__version__"], @@ -65,6 +59,6 @@ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], - packages=["packaging"], - package_data={"packaging": ["py.typed"]}, + packages=["packaging2"], + package_data={"packaging2": ["py.typed"]}, ) diff --git a/tasks/check.py b/tasks/check.py index b0896e1f..85d075cc 100644 --- a/tasks/check.py +++ b/tasks/check.py @@ -11,7 +11,7 @@ import pkg_resources import progress.bar -from packaging.version import Version +from packaging2.version import Version from .paths import CACHE diff --git a/tests/test_manylinux.py b/tests/test_manylinux.py index a04db159..23d6af5d 100644 --- a/tests/test_manylinux.py +++ b/tests/test_manylinux.py @@ -11,8 +11,8 @@ import pretend import pytest -from packaging import _manylinux -from packaging._manylinux import ( +from packaging2 import _manylinux +from packaging2._manylinux import ( _ELFFileHeader, _get_elf_header, _get_glibc_version, diff --git a/tests/test_markers.py b/tests/test_markers.py index c2640afe..68c7d903 100644 --- a/tests/test_markers.py +++ b/tests/test_markers.py @@ -10,7 +10,7 @@ import pytest -from packaging.markers import ( +from packaging2.markers import ( InvalidMarker, Marker, Node, diff --git a/tests/test_musllinux.py b/tests/test_musllinux.py index d2c87ca1..17024317 100644 --- a/tests/test_musllinux.py +++ b/tests/test_musllinux.py @@ -7,8 +7,8 @@ import pretend import pytest -from packaging import _musllinux -from packaging._musllinux import ( +from packaging2 import _musllinux +from packaging2._musllinux import ( _get_musl_version, _MuslVersion, _parse_ld_musl_from_elf, diff --git a/tests/test_requirements.py b/tests/test_requirements.py index f2c209c4..622e0534 100644 --- a/tests/test_requirements.py +++ b/tests/test_requirements.py @@ -4,9 +4,9 @@ import pytest -from packaging.markers import Marker -from packaging.requirements import URL, URL_AND_MARKER, InvalidRequirement, Requirement -from packaging.specifiers import SpecifierSet +from packaging2.markers import Marker +from packaging2.requirements import URL, URL_AND_MARKER, InvalidRequirement, Requirement +from packaging2.specifiers import SpecifierSet class TestRequirements: diff --git a/tests/test_specifiers.py b/tests/test_specifiers.py index ca21fa1d..1e14b057 100644 --- a/tests/test_specifiers.py +++ b/tests/test_specifiers.py @@ -8,13 +8,13 @@ import pytest -from packaging.specifiers import ( +from packaging2.specifiers import ( InvalidSpecifier, LegacySpecifier, Specifier, SpecifierSet, ) -from packaging.version import LegacyVersion, Version, parse +from packaging2.version import LegacyVersion, Version, parse from .test_version import LEGACY_VERSIONS, VERSIONS diff --git a/tests/test_structures.py b/tests/test_structures.py index f8115e57..95afca28 100644 --- a/tests/test_structures.py +++ b/tests/test_structures.py @@ -4,7 +4,7 @@ import pytest -from packaging._structures import Infinity, NegativeInfinity +from packaging2._structures import Infinity, NegativeInfinity def test_infinity_repr(): diff --git a/tests/test_tags.py b/tests/test_tags.py index 446dee4e..2f0b8eb2 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -19,8 +19,8 @@ import pretend import pytest -from packaging import tags -from packaging._musllinux import _MuslVersion +from packaging2 import tags +from packaging2._musllinux import _MuslVersion @pytest.fixture diff --git a/tests/test_utils.py b/tests/test_utils.py index be52d670..a9471e0a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -4,8 +4,8 @@ import pytest -from packaging.tags import Tag -from packaging.utils import ( +from packaging2.tags import Tag +from packaging2.utils import ( InvalidSdistFilename, InvalidWheelFilename, canonicalize_name, @@ -13,7 +13,7 @@ parse_sdist_filename, parse_wheel_filename, ) -from packaging.version import Version +from packaging2.version import Version @pytest.mark.parametrize( diff --git a/tests/test_version.py b/tests/test_version.py index 5f2251e1..76ece017 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -9,7 +9,7 @@ import pretend import pytest -from packaging.version import InvalidVersion, LegacyVersion, Version, parse +from packaging2.version import InvalidVersion, LegacyVersion, Version, parse @pytest.mark.parametrize(