File tree Expand file tree Collapse file tree 4 files changed +71
-44
lines changed Expand file tree Collapse file tree 4 files changed +71
-44
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : Check and Publish
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ codespell :
7
+ name : Codespell
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v4
11
+ - run : make qa-codespell
12
+
13
+ pytest :
14
+ name : Python Test
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+ - run : make qa-pytest
19
+
20
+ ruff :
21
+ name : Python Format and Lint
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - uses : actions/checkout@v4
25
+ - run : make qa-ruff
26
+
27
+ build :
28
+ name : Python Build
29
+ runs-on : ubuntu-latest
30
+ steps :
31
+ - uses : actions/checkout@v4
32
+ with :
33
+ # include tags and full history for setuptools_scm
34
+ fetch-depth : 0
35
+ - run : make build
36
+ - uses : actions/upload-artifact@v4
37
+ with :
38
+ name : dist
39
+ path : dist
40
+
41
+ publish :
42
+ name : Publish
43
+ if : ${{ github.event_name == 'push' && vars.PUBLISH_PYPI == 'true' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master') }}
44
+ runs-on : ubuntu-latest
45
+ needs :
46
+ - codespell
47
+ - pytest
48
+ - ruff
49
+ - build
50
+ permissions :
51
+ id-token : write
52
+ steps :
53
+ - name : Download artifacts from build stage
54
+ uses : actions/download-artifact@v4
55
+ with :
56
+ name : dist
57
+ path : dist/
58
+ - name : Publish distribution package to TestPyPI
59
+ uses : pypa/gh-action-pypi-publish@release/v1
60
+ with :
61
+ repository-url : https://test.pypi.org/legacy/
62
+ - name : Publish distribution package to PyPI
63
+ if : ${{ startsWith(github.ref, 'refs/tags') }}
64
+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ $(PYTHON_PACKAGING_VENV)/.created:
12
12
$(PYTHON ) -m venv $(PYTHON_PACKAGING_VENV ) && \
13
13
. $(PYTHON_PACKAGING_VENV ) /bin/activate && \
14
14
$(PYTHON ) -m pip install --upgrade pip && \
15
- $(PYTHON ) -m pip install build twine
15
+ $(PYTHON ) -m pip install build
16
16
date > $(PYTHON_PACKAGING_VENV ) /.created
17
17
18
- .PHONY : packaging-env build _release
18
+ .PHONY : packaging-env build
19
19
20
20
packaging-env : $(PYTHON_PACKAGING_VENV ) /.created
21
21
@@ -24,10 +24,6 @@ build: packaging-env
24
24
rm -rf dist * .egg-info && \
25
25
$(PYTHON ) -m build
26
26
27
- _release : build
28
- . $(PYTHON_PACKAGING_VENV ) /bin/activate && \
29
- $(PYTHON ) -m twine upload dist/*
30
-
31
27
# helper ######################################################################
32
28
.PHONY : clean envs
33
29
Original file line number Diff line number Diff line change 1
1
[build-system ]
2
- requires = [" setuptools" ]
2
+ requires = [" setuptools" , " setuptools_scm[toml] " ]
3
3
build-backend = " setuptools.build_meta"
4
4
5
5
[project ]
6
6
name = " usbsdmux"
7
7
description = " Tool to control an USB-SD-Mux from the command line"
8
- version = " 24.01.1"
9
8
authors = [
10
9
{
name =
" Chris Fiege" ,
email =
" [email protected] " },
11
10
]
@@ -18,6 +17,7 @@ classifiers = [
18
17
" Operating System :: Unix" ,
19
18
" Programming Language :: Python :: 3 :: Only" ,
20
19
]
20
+ dynamic = [" version" ] # via setuptools_scm
21
21
22
22
[project .optional-dependencies ]
23
23
mqtt = [" paho-mqtt" ]
@@ -37,6 +37,9 @@ packages = [
37
37
]
38
38
include-package-data = true
39
39
40
+ [tool .setuptools_scm ]
41
+ local_scheme = " no-local-version"
42
+
40
43
[tool .ruff ]
41
44
line-length = 119
42
45
exclude = [
You can’t perform that action at this time.
0 commit comments