Skip to content

Commit ab5063e

Browse files
committed
Merge branch 'maintenance/gha-ci-cd'
2 parents 5a196ff + a6cde65 commit ab5063e

File tree

9 files changed

+1667
-52
lines changed

9 files changed

+1667
-52
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1112 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/reusable-tox.yml

Lines changed: 415 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/scheduled-runs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
3+
name:
4+
5+
on:
6+
pull_request:
7+
paths: # only changes to this workflow itself trigger PR testing
8+
- .github/workflows/scheduled-runs.yml
9+
schedule:
10+
- cron: 7 6 * * * # run daily at 6:07 UTC
11+
workflow_dispatch: # manual trigger
12+
13+
run-name: >-
14+
🌃
15+
Nightly run of
16+
${{
17+
github.event.pull_request.number && 'PR' || ''
18+
}}${{
19+
!github.event.pull_request.number && 'Commit' || ''
20+
}}
21+
${{ github.event.pull_request.number || github.sha }}
22+
triggered by: ${{ github.event_name }} of ${{
23+
github.ref
24+
}} ${{
25+
github.ref_type
26+
}}
27+
(workflow run ID: ${{
28+
github.run_id
29+
}}; number: ${{
30+
github.run_number
31+
}}; attempt: ${{
32+
github.run_attempt
33+
}})
34+
35+
jobs:
36+
main-ci-cd-pipeline:
37+
name: 🧪 Main CI/CD pipeline
38+
uses: ./.github/workflows/ci-cd.yml
39+
secrets: inherit
40+
41+
...

.github/workflows/tests.yml

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

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ requests-unixsocket
44
.. image:: https://badge.fury.io/py/requests-unixsocket.svg
55
:target: https://badge.fury.io/py/requests-unixsocket
66
:alt: Latest Version on PyPI
7-
8-
.. image:: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml/badge.svg
9-
:target: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml
7+
8+
.. image:: https://github.com/msabramo/requests-unixsocket/actions/workflows/ci-cd.yml/badge.svg?event=push
9+
:target: https://github.com/msabramo/requests-unixsocket/actions/workflows/ci-cd.yml
1010

1111
Use `requests <http://docs.python-requests.org/>`_ to talk HTTP via a UNIX domain socket
1212

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ requires = [
55
]
66
build-backend = "setuptools.build_meta"
77

8+
[dependency-groups]
9+
building = [
10+
"build",
11+
]
12+
testing = [
13+
"pep8",
14+
"pytest",
15+
"pytest-cache",
16+
"pytest-pep8",
17+
"waitress",
18+
]
19+
upstreaming = [
20+
"setuptools-scm",
21+
"twine",
22+
]
23+
824
[project]
925
name = "requests-unixsocket"
1026
description = "Use requests to talk HTTP via a UNIX domain socket"

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-requirements.txt

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

tox.ini

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,88 @@
11
[tox]
22
envlist = py37, py38, py39, py310, flake8
33

4+
5+
[python-cli-options]
6+
byte-warnings = -b
7+
byte-errors = -bb
8+
max-isolation = -E -s -I
9+
some-isolation = -E -s
10+
warnings-to-errors = -Werror
11+
12+
413
[testenv]
514
commands = py.test {posargs:requests_unixsocket/tests}
6-
deps =
7-
-r{toxinidir}/requirements.txt
8-
-r{toxinidir}/test-requirements.txt
15+
dependency_groups =
16+
testing
17+
18+
19+
[testenv:cleanup-dists]
20+
description =
21+
Wipe the the dist{/} folder
22+
dependency_groups =
23+
commands_pre =
24+
commands =
25+
{envpython} \
26+
{[python-cli-options]byte-errors} \
27+
{[python-cli-options]max-isolation} \
28+
{[python-cli-options]warnings-to-errors} \
29+
-c \
30+
'import os, shutil, sys; \
31+
dists_dir = "{toxinidir}{/}dist{/}"; \
32+
shutil.rmtree(dists_dir, ignore_errors=True); \
33+
sys.exit(os.path.exists(dists_dir))'
34+
commands_post =
35+
package = skip
36+
37+
38+
[testenv:build-dists]
39+
description =
40+
Build dists with {basepython} and put them into the dist{/} folder
41+
dependency_groups =
42+
building
43+
depends =
44+
cleanup-dists
45+
commands =
46+
{envpython} \
47+
{[python-cli-options]byte-errors} \
48+
{[python-cli-options]max-isolation} \
49+
{[python-cli-options]warnings-to-errors} \
50+
-m build \
51+
{posargs:}
52+
commands_post =
53+
package = skip
54+
55+
56+
[testenv:metadata-validation]
57+
description =
58+
Verify that dists under the `dist{/}` dir
59+
have valid metadata
60+
dependency_groups =
61+
upstreaming
62+
depends =
63+
build-dists
64+
commands_pre =
65+
{envpython} \
66+
{[python-cli-options]byte-errors} \
67+
{[python-cli-options]max-isolation} \
68+
{[python-cli-options]warnings-to-errors} \
69+
'-Wdefault{:}git archive did not support describe output\
70+
{:}UserWarning{:}setuptools_scm.git' \
71+
'-Wdefault{:}unprocessed git archival found\
72+
{:}UserWarning{:}setuptools_scm.git' \
73+
-m setuptools_scm \
74+
ls
75+
commands =
76+
{envpython} \
77+
{[python-cli-options]byte-errors} \
78+
{[python-cli-options]max-isolation} \
79+
{[python-cli-options]warnings-to-errors} \
80+
-m twine \
81+
check \
82+
--strict \
83+
dist{/}*
84+
commands_post =
85+
package = skip
986

1087
[testenv:flake8]
1188
commands = flake8

0 commit comments

Comments
 (0)