Skip to content

Commit 46b33ac

Browse files
committed
chore(deps): migrate dependency management to poetry
1 parent 7aa484b commit 46b33ac

9 files changed

Lines changed: 1278 additions & 119 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
- name: 👷🏻 Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install -r requirements.txt pytest
28+
pip install poetry && poetry install --with test,dev
2929
3030
- name: 🕵🏻 Test with pytest
31-
run: pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml
31+
run: poetry run pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml
3232

3333
- name: 🚀 Upload pytest test results
3434
uses: actions/upload-artifact@v4
@@ -57,8 +57,8 @@ jobs:
5757
- name: 👷🏻 Install dependencies
5858
run: |
5959
python -m pip install --upgrade pip
60-
pip install -r requirements.txt pylint pylint-exit
60+
pip install poetry && poetry install --with test,dev
6161
6262
- name: 🕵🏻 Analyse code with pylint
6363
run: |
64-
pylint --init-hook="import sys; import os; sys.path.append(os.path.abspath('.'));" $(git ls-files '*.py') || pylint-exit $?
64+
poetry run pylint --init-hook="import sys; import os; sys.path.append(os.path.abspath('.'));" $(git ls-files '*.py') || poetry run pylint-exit $?

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: 👷🏻 Install dependencies
4545
run: |
4646
python -m pip install --upgrade pip
47-
pip install -r requirements-ci.txt
47+
pip install poetry && poetry install
4848
4949
- name: 👾 Set up QEMU
5050
uses: docker/setup-qemu-action@v3
@@ -64,4 +64,4 @@ jobs:
6464
env:
6565
GITHUB_TOKEN: ${{ secrets.SEMANTIC_PAT_TOKEN }}
6666
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
67-
run: python -m semantic_release publish --verbosity=DEBUG
67+
run: poetry run semantic-release publish

aps2mqtt/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "1.2.0"

poetry.lock

Lines changed: 1237 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 34 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,38 @@
1-
[tool.black]
2-
line-length = 100
3-
4-
[build-system]
5-
requires = ["setuptools"]
6-
build-backend = "setuptools.build_meta"
71

82
[tool.semantic_release]
9-
version_variables = ["setup.py:__version__"]
10-
assets = ["dist/*.whl"]
11-
commit_message = "[release] {version}\n\nAutomatically generated by python-semantic-release"
12-
commit_parser = "angular"
13-
logging_use_named_masks = false
14-
major_on_zero = true
15-
tag_format = "v{version}"
16-
17-
[tool.semantic_release.branches.main]
18-
match = "(main|master)"
19-
prerelease_token = "rc"
20-
prerelease = false
21-
22-
[tool.semantic_release.changelog]
23-
template_dir = "templates"
3+
version_variable = "aps2mqtt/__init__.py:__version__"
4+
branch = "main"
245
changelog_file = "CHANGELOG.md"
25-
exclude_commit_patterns = []
26-
27-
[tool.semantic_release.changelog.environment]
28-
block_start_string = "{%"
29-
block_end_string = "%}"
30-
variable_start_string = "{{"
31-
variable_end_string = "}}"
32-
comment_start_string = "{#"
33-
comment_end_string = "#}"
34-
trim_blocks = false
35-
lstrip_blocks = false
36-
newline_sequence = "\n"
37-
keep_trailing_newline = false
38-
extensions = []
39-
autoescape = true
40-
41-
[tool.semantic_release.commit_author]
42-
env = "GIT_COMMIT_AUTHOR"
43-
default = "semantic-release <semantic-release>"
44-
45-
[tool.semantic_release.commit_parser_options]
46-
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
47-
minor_tags = ["feat"]
48-
patch_tags = ["fix", "perf"]
49-
50-
[tool.semantic_release.remote]
51-
name = "origin"
52-
type = "github"
53-
ignore_token_for_push = false
54-
55-
[tool.semantic_release.remote.token]
56-
env = "GITHUB_TOKEN"
57-
58-
[tool.semantic_release.publish]
59-
dist_glob_patterns = ["dist/*"]
60-
upload_to_vcs_release = true
61-
62-
[tool.semantic_release.publish.docker]
63-
enabled = true
64-
match_branch = "main"
65-
registry = "docker.io"
66-
image = "aps2mqtt"
67-
user = "${{ secrets.DOCKERHUB_USERNAME }}"
68-
6+
build_command = "pip install build && python -m build"
7+
dist_path = "dist/"
8+
upload_to_pypi = "true"
9+
upload_to_release = "true"
10+
11+
[tool.poetry]
12+
name = "aps2mqtt"
13+
version = "1.2.0"
14+
description = "Publish APS ECU data to MQTT broker"
15+
authors = ["Florian Ligneul <contact@florian-ligneul.fr>"]
16+
license = "GPLv3"
17+
readme = "README.md"
18+
packages = [{include = "aps2mqtt"}]
19+
20+
[tool.poetry.dependencies]
21+
python = "^3.9"
22+
requests = "^2.32.4"
23+
paho-mqtt = "^1.6.1"
24+
pyyaml = "^6.0.2"
25+
str2bool = "^1.1"
26+
suntime = "^1.2.5"
27+
python-semantic-release = "^10.2.0"
28+
29+
[tool.poetry.group.test.dependencies]
30+
pytest = "^8.4.1"
31+
32+
[tool.poetry.group.dev.dependencies]
33+
pylint = "^3.3.7"
34+
pylint-exit = "^1.2.0"
6935

36+
[build-system]
37+
requires = ["poetry-core"]
38+
build-backend = "poetry.core.masonry.api"

requirements-ci.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 28 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)