Skip to content

Commit 6cf9b71

Browse files
committed
chore: migrate to modern tooling
Switch to pyproject.toml & python -m build
1 parent b8fce3e commit 6cf9b71

File tree

6 files changed

+108
-799
lines changed

6 files changed

+108
-799
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
python-version: "3.10"
1919
- name: 🏗 Install build dependencies
2020
run: >-
21-
python -m pip install wheel --user
21+
python -m pip install wheel build --user
2222
- name: 🔨 Build a binary wheel and a source tarball
2323
run: >-
24-
python setup.py sdist bdist_wheel
24+
python -m build
2525
- name: ⬆ Upload build result
2626
uses: actions/upload-artifact@v4
2727
with:

Taskfile.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# https://taskfile.dev
2+
3+
version: "3"
4+
5+
env:
6+
LOCALES:
7+
- de
8+
TRANSLATIONS: octoprint_file_check/translations
9+
10+
tasks:
11+
install:
12+
desc: Installs the plugin into the current venv
13+
cmds:
14+
- "python -m pip install -e ."
15+
16+
### Build related
17+
18+
build:
19+
desc: Builds sdist & wheel
20+
cmds:
21+
- python -m build --sdist --wheel
22+
23+
build-sdist:
24+
desc: Builds sdist
25+
cmds:
26+
- python -m build --sdist
27+
28+
build-wheel:
29+
desc: Builds wheel
30+
cmds:
31+
- python -m build --wheel
32+
33+
update-assets:
34+
desc: Updates all assets
35+
cmds:
36+
- octoprint dev css:build --all
37+
38+
### Translation related
39+
40+
babel-extract:
41+
desc: Update pot file from source
42+
cmds:
43+
- pybabel extract --mapping-file=babel.cfg --output-file=translations/messages.pot --msgid-bugs-address=i18n@octoprint.org --copyright-holder="The OctoPrint Project" .
44+
45+
babel-update:
46+
desc: Update translation files from pot file
47+
cmds:
48+
- for:
49+
var: LOCALES
50+
cmd: pybabel update --input-file=translations/messages.pot --output-dir=translations --locale={{ .ITEM }}
51+
52+
babel-refresh:
53+
desc: Update translation files from source
54+
cmds:
55+
- task: babel-extract
56+
- task: babel-update
57+
58+
babel-compile:
59+
desc: Compile translation files
60+
cmds:
61+
- pybabel compile --directory=translations
62+
63+
babel-bundle:
64+
desc: Bundle translations
65+
cmds:
66+
- for:
67+
var: LOCALES
68+
cmd: |
69+
locale="{{ .ITEM }}"
70+
source="translations/${locale}"
71+
target="{{ .TRANSLATIONS }}/${locale}"
72+
73+
[ ! -d "${target}" ] || rm -r "${target}"
74+
75+
echo "Copying translations for locale ${locale} from ${source} to ${target}..."
76+
cp -r "${source}" "${target}"

pyproject.toml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
11
[build-system]
2-
requires = ["setuptools>=40.8.0", "wheel"]
2+
requires = ["setuptools>=67", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "OctoPrint-FileCheck"
7+
version = "2024.11.12"
8+
description = "Checks for common issues in uploaded files"
9+
authors = [
10+
{name = "Gina Häußge", email = "gina@octoprint.org"}
11+
]
12+
maintainers = [
13+
{name = "Gina Häußge", email = "gina@octoprint.org"}
14+
]
15+
readme = {file = "README.md", content-type = "markdown"}
16+
license = "AGPL-3.0-or-later"
17+
license-files = ["LICENSE"]
18+
19+
requires-python = ">=3.7, <3.14"
20+
21+
[tool.setuptools]
22+
include-package-data = true
23+
packages = ["octoprint_file_check"]
24+
25+
[project.entry-points."octoprint.plugin"]
26+
file_check = "octoprint_file_check"
27+
28+
[project.optional-dependencies]
29+
develop = [
30+
"pre-commit",
31+
"go-task-bin"
32+
]
33+
534
[tool.ruff]
635
exclude = [
736
# standard stuff

requirements.txt

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

setup.cfg

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

0 commit comments

Comments
 (0)