Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to pyproject.toml and hatch #371

Merged
merged 3 commits into from
Sep 21, 2023
Merged

chore: migrate to pyproject.toml and hatch #371

merged 3 commits into from
Sep 21, 2023

Commits on Sep 20, 2023

  1. chore: update pre-commit config

    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    9655922 View commit details
    Browse the repository at this point in the history
  2. chore!: migrate to pyproject.toml and hatch

    The previous build process relied on `distutils` which is due to be
    deprecated in 3.12. Furthermore, the use of `setup.py` is now
    discouraged.
    
    The choice to migrate to `hatch` was made for the following reasons:
    
    - It offers a very simple management of the venv. No more need to
      `python -m venv .venv` and `pip install`, `hatch` handles all of that
      automatically when creating the virtual environment.
    - `hatch` supercedes `tox`, allowing for multiple python versions to be
      tested in a single command.
    - `hatch` manages the build process, and offers a nicer way to hook in a
      custom build process to download the `pact` standalone binaries.
    
    A minor change to the packaging of the library now places the binaries
    in `pact/bin` instead of `pact/bin/pact/bin`. The `constants.py` file
    has been accordingly updated to reflect this change in case anyone was
    making direct use of the binaries.
    
    While this change is rather significant, it should not affect the end
    user experience. Users will still be able to `pip install pact-python`
    from PyPI. Other than for the aforementioned, there has been no changes
    to the library code.
    
    Official support to Python 3.6 and 3.7 is dropped as part of this
    change as security fixes for these versions are no longer
    provided (ended 21 months ago for 3.6, and 3 months ago for 3.7).
    Furthermore, a number of dependencies have dropped support for these
    versions, and pinning historical versions of these dependencies is
    introducing known security vulnerabilities.
    
    BREAKING CHANGE: Drop support for Python 3.6 and 3.7
    Resolves: #369
    Refs: https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated
    Refs: https://setuptools.pypa.io/en/latest/userguide/quickstart.html#setuppy-discouraged
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    5f65fa0 View commit details
    Browse the repository at this point in the history
  3. chore(ci): migrate cicd to hatch

    With Hatch as the new build system, the previous GitHub actions no
    longer work to lint, test, and publish the package.
    
    This commit makes use of pypa/cibuildwheel to build the package for
    multiple platforms, and then publishes the package to PyPI using the
    existing secrets.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    6f82d7e View commit details
    Browse the repository at this point in the history