diff --git a/CHANGELOG.md b/CHANGELOG.md index 696b2367..d2c67dd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## master - CURRENT +### Modified +* Migrate from Poetry to UV to manage the project ## 3.25.0 - 16/11/2023 ### Added diff --git a/docs/conf.py b/docs/conf.py index eba12bfd..8f8ea79d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,7 +7,7 @@ master_doc = "index" project = "DNSroboCert" -version = release = pyproject_toml["tool"]["poetry"]["version"] +version = release = pyproject_toml["project"]["version"] author = "Adrien Ferrand" copyright = "2022, Adrien Ferrand" diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 90f583d6..59f57da9 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -33,15 +33,15 @@ It sits on top of Certbot_ and Lexicon_. Here are the repartition of the roles: Setting up a development environment ==================================== -DNSroboCert uses Poetry_ to configure an environment development, build the project, and push wheel/sdist to PyPI. +DNSroboCert uses UV_ to manage the development environment & dependencies, build the project, and push wheel/sdist to PyPI. -1. First, install Poetry_, following this guide: `Poetry installation`_. +1. First, install UV_, following this guide: `UV installation`_. -2. Now Poetry should be available in your command line. Check that the following command is displaying Poetry version: +2. Now UV should be available in your command line. Check that the following command is displaying UV version: .. code-block:: console - poetry --version + uv --version 3. Fork the upstream `GitHub project`_ and clone your fork locally: @@ -56,12 +56,12 @@ DNSroboCert uses Poetry_ to configure an environment development, build the proj | It allows in particular to have a separated set of dependencies for the project that will not interfere with the OS Python packages installed globally. -4. Setup the virtual environment for DNSroboCert using Poetry: +4. Setup the virtual environment for DNSroboCert using UV: .. code-block:: console cd dnsrobocert - poetry env use python3 + uv sync 5. Activate the virtual environment: @@ -77,20 +77,14 @@ DNSroboCert uses Poetry_ to configure an environment development, build the proj .\.venv\Scripts\activate -6. Install development dependencies. - -.. code-block:: console - - poetry install - At this point, you are ready to develop on the project. You can run the CLI that will use the local source code: .. code-block:: console dnsrobocert --help -.. _Poetry: https://python-poetry.org/ -.. _Poetry installation: https://python-poetry.org/docs/#installation +.. _UV: https://docs.astral.sh/uv/ +.. _UV installation: https://docs.astral.sh/uv/getting-started/installation/ .. _GitHub project: https://github.com/adferrand/docker-letsencrypt-dns Code quality diff --git a/utils/create_release.py b/utils/create_release.py index 3aa6d78d..8134942f 100755 --- a/utils/create_release.py +++ b/utils/create_release.py @@ -15,8 +15,10 @@ def main(): raise RuntimeError("Error, git workspace is not clean: \n{0}".format(git_clean)) current_version = subprocess.check_output( - "poetry version", shell=True, universal_newlines=True - ).replace("dnsrobocert ", "") + "uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version", + shell=True, + universal_newlines=True, + ) print("Current version is: {0}".format(current_version)) print("Please insert new version:") @@ -51,9 +53,14 @@ def main(): with open("CHANGELOG.md", "w") as f: f.write(changelog) - subprocess.check_call("poetry version {0}".format(new_version), shell=True) - subprocess.check_call("poetry run isort src test utils", shell=True) - subprocess.check_call("poetry run black src test utils", shell=True) + subprocess.check_call( + "uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version {0}".format( + new_version + ), + shell=True, + ) + subprocess.check_call("uv run isort src test utils", shell=True) + subprocess.check_call("uv run black src test utils", shell=True) subprocess.check_call( 'git commit -a -m "Version {0}"'.format(new_version), shell=True