diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 622d8f8..d608500 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["2.7", "3.6", "3.9"] + python-version: ["2.7", "3.6", "3.10"] os: ["ubuntu-latest", "windows-latest", "macos-latest"] include: - os: ubuntu-latest python-version: "3.7" - os: ubuntu-latest python-version: "3.8" + - os: ubuntu-latest + python-version: "3.9" steps: - uses: "actions/checkout@v2" - uses: "actions/setup-python@v2" diff --git a/HISTORY.rst b/HISTORY.rst index cc6cc3c..5c6dc7a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,5 +1,10 @@ +1.0 (2022-09-27) +================ + +Release 1.0, no feature change. + 0.10.1 (2022-09-07) -================= +=================== Deprecations and Removals ------------------------- diff --git a/README.rst b/README.rst index 3d0ca6e..2bba4cc 100644 --- a/README.rst +++ b/README.rst @@ -31,8 +31,8 @@ This includes: - updating the environment with new dependencies as the project evolves, - uninstalling unused dependencies, - refreshing dependencies, -- maintaining pinned versions in ``requirements.txt``, -- pinning versions for extras in ``requirements-{extra}.txt`` +- maintaining pinned in ``requirements.txt`` lock files, +- pinning versions for extras in ``requirements-{extra}.txt`` lock files, - displaying installed dependencies as a tree. A few characteristics of this project: @@ -43,7 +43,7 @@ A few characteristics of this project: - It relies on the documented ``pip`` command line interface and its ubiquitous `requirements file format `__. -- It assumes your project is configured using a PEP 517 compliant build +- It assumes your project is configured using a PEP 517/660 compliant build backend but otherwise makes no assumption on the specific backend used. - It has first class support for dependencies specified as VCS references. @@ -52,12 +52,6 @@ A few characteristics of this project: - It is reasonably small and simple, with good test coverage and is hopefully easy to maintain. -.. warning:: - - While ``pip-deepfreeze`` is functional already, this is to be considered as - alpha software for a little while, until we have gathered some feedback on - the CLI options. - Installation ------------ @@ -87,11 +81,9 @@ Quick start .. image:: https://raw.githubusercontent.com/sbidoul/pip-deepfreeze/a148bcce2920025a30bcc16cfb6dbc2b9a1ca68d/docs/synopsis.png :alt: pip-deepfreeze synopsis -Make sure your application declares its direct dependencies using `setuptools -`__ (via the ``install_requires`` key in -``setup.py`` or ``setup.cfg``), or any other compliant `PEP 517 -`__ build backend such as `flit -`__. +Make sure your application declares its direct dependencies in `pyproject.toml +`_, +or any other mechanism supported by your PEP 517/660 compliant build backend. Create and activate a virtual environment using your favorite tool. Run ``pip list`` to make sure ``pip``, ``setuptools`` and ``wheel`` are installed @@ -143,8 +135,8 @@ How to Creating a new project. - Follow the instructions of your favorite PEP 517 compliant build tool, such - as ``setuptools``, ``flit`` or others. After declaring the first + Follow the instructions of your favorite PEP 517/660 compliant build tool, such + as ``hatch``, ``setuptools``, ``flit`` or others. After declaring the first dependencies, create and activate a virtualenv, then run ``pip-df sync`` in the project directory to generate pinned dependencies in ``requirements.txt``. @@ -221,13 +213,11 @@ FAQ What should I put in ``requirements.txt.in``? Should I add all my dependencies there? - ``requirements.txt.in`` is optional. The dependencies of your project must - be declared primarily in ``setup.py`` or ``setup.cfg`` (if you use - ``setuptools``), or in ``pyproject.toml`` if you use another PEP 517 build - backend such as ``flit``. ``requirements.txt.in`` may contain additional - constraints if needed, such as version constraints on indirect dependencies - that you don't control, or VCS links for dependencies that you need to - install from VCS source. + ``requirements.txt.in`` is optional. The dependencies of your project must be + declared primarily in ``pyproject.toml`` (or the legacy ``setup.py/setup.cfg``). + ``requirements.txt.in`` may contain additional constraints if needed, such as version + constraints on indirect dependencies that you don't control, or VCS links for + dependencies that you need to install from VCS source. I have added a constraint in ``requirements.txt.in`` but ``pip-df sync`` does not honor it. What is going on? @@ -325,7 +315,8 @@ pip-df sync Usage: pip-df sync [OPTIONS] - Install/update the environment to match the project requirements. + Install/update the environment to match the project requirements, and lock new + dependencies. Install/reinstall the project. Install/update dependencies to the latest allowed version according to pinned dependencies in requirements.txt or diff --git a/pyproject.toml b/pyproject.toml index 407f816..b28704a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,53 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel", "setuptools_scm[toml]>=3.4"] -build-backend = "setuptools.build_meta" +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "pip-deepfreeze" +description = "A simple pip freeze workflow for Python application developers." +readme = "README.rst" +authors = [{name = "Stéphane Bidoul", email = "stephane.bidoul@gmail.com"}] +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +requires-python = ">=3.6" +dependencies=[ + "httpx", + "importlib_resources ; python_version<'3.7'", + "packaging>=20.4", + "toml", + "typer[all]>=0.3.2", + "typing-extensions ; python_version<'3.8'", # for Protocol, TypedDict +] +dynamic = ["version"] + +[project.optional-dependencies] +"test" = ["pytest", "pytest-cov", "pytest-xdist", "virtualenv"] +"mypy" = ["mypy==0.800"] + +[project.entry-points.console_scripts] +pip-df = "pip_deepfreeze.__main__:main" +pip-deepfreeze = "pip_deepfreeze.__main__:main" + +[project.urls] +"Source" = "https://github.com/sbidoul/pip-deepfreeze/" +"Bug Reports" = "https://github.com/sbidoul/pip-deepfreeze/issues" +"Changelog" = "https://github.com/sbidoul/pip-deepfreeze/blob/master/HISTORY.rst" + +[tool.hatch.version] +source = "vcs" [tool.isort] # see https://github.com/psf/black diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fcf168c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[metadata] -# This includes the license file(s) in the wheel. -name = pip-deepfreeze -license_files = LICENSE.txt diff --git a/setup.py b/setup.py deleted file mode 100644 index 92148e7..0000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -import pathlib - -from setuptools import setup - -here = pathlib.Path(__file__).parent.resolve() -long_description = (here / "README.rst").read_text(encoding="utf-8") - -setup( - name="pip-deepfreeze", - use_scm_version=True, - description="A simple pip freeze workflow for Python application developers.", - long_description=long_description, - long_description_content_type="text/x-rst", - url="https://github.com/sbidoul/pip-deepfreeze", - author="Stéphane Bidoul", - author_email="stephane.bidoul@gmail.com", - license="MIT", - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - ], - package_dir={"": "src"}, - packages=["pip_deepfreeze"], - python_requires=">=3.6", - install_requires=[ - "httpx", - 'importlib_resources ; python_version<"3.7"', - "packaging>=20.4", - "toml", - "typer[all]>=0.3.2", - 'typing-extensions ; python_version<"3.8"', # for Protocol, TypedDict - ], - extras_require={ - "test": ["pytest", "pytest-cov", "pytest-xdist", "virtualenv"], - "mypy": ["mypy==0.800"], - }, - entry_points={ - "console_scripts": [ - "pip-df=pip_deepfreeze.__main__:main", - "pip-deepfreeze=pip_deepfreeze.__main__:main", - ] - }, - project_urls={ - "Source": "https://github.com/sbidoul/pip-deepfreeze/", - "Bug Reports": "https://github.com/sbidoul/pip-deepfreeze/issues", - "Changelog": ( - "https://github.com/sbidoul/pip-deepfreeze/blob/master/HISTORY.rst" - ), - }, -)