Skip to content

Commit

Permalink
Update documentation and setup
Browse files Browse the repository at this point in the history
  • Loading branch information
adferrand committed Dec 6, 2024
1 parent 4165147 commit 2fefec5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## master - CURRENT
### Modified
* Migrate from Poetry to UV to manage the project

## 3.25.0 - 16/11/2023
### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
22 changes: 8 additions & 14 deletions docs/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:

Expand All @@ -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
Expand Down
17 changes: 12 additions & 5 deletions utils/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2fefec5

Please sign in to comment.