Skip to content

Commit 54d192a

Browse files
authored
Merge pull request #200 from nicoddemus/improved-ci
Improve CI and move to src layout
2 parents 1cb4284 + 452b223 commit 54d192a

25 files changed

+124
-79
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# restructured text files forced to LF because of doc8 pre-commit hook.
2+
*.rst eol=lf

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: deploy
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
default: '1.2.3'
10+
11+
jobs:
12+
13+
package:
14+
runs-on: ubuntu-latest
15+
env:
16+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Build and Check Package
22+
uses: hynek/[email protected]
23+
24+
deploy:
25+
needs: package
26+
runs-on: ubuntu-latest
27+
environment: deploy
28+
permissions:
29+
id-token: write # For PyPI trusted publishers.
30+
contents: write # For tag.
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
35+
- name: Download Package
36+
uses: actions/download-artifact@v3
37+
with:
38+
name: Packages
39+
path: dist
40+
41+
- name: Publish package to PyPI
42+
uses: pypa/[email protected]
43+
44+
- name: Push tag
45+
run: |
46+
git config user.name "pytest bot"
47+
git config user.email "[email protected]"
48+
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
49+
git push origin v${{ github.event.inputs.version }}

.github/workflows/main.yml

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

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
- "test-me-*"
8+
9+
pull_request:
10+
branches:
11+
- "master"
12+
13+
# Cancel running jobs for the same workflow and branch.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
20+
package:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Build and Check Package
25+
uses: hynek/[email protected]
26+
27+
test:
28+
29+
needs: [package]
30+
31+
runs-on: ${{ matrix.os }}
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [ windows-latest, ubuntu-latest ]
37+
python: [ "3.7","3.8","3.10","3.11", "pypy-3.7" ]
38+
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Download Package
45+
uses: actions/download-artifact@v3
46+
with:
47+
name: Packages
48+
path: dist
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: ${{ matrix.python }}
54+
55+
- name: Install tox
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install tox
59+
60+
- name: Test
61+
shell: bash
62+
run: |
63+
tox run -e py --installpkg `find dist/*.tar.gz`

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
doc/_build
22
build/
3-
execnet.egg-info/
4-
execnet/_version.py
3+
src/execnet/_version.py
54
dist/
65
.pytest_cache/
76
.eggs/

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Important
1313
.. image:: https://img.shields.io/pypi/pyversions/execnet.svg
1414
:target: https://pypi.org/project/execnet/
1515

16-
.. image:: https://github.com/pytest-dev/execnet/workflows/build/badge.svg
17-
:target: https://github.com/pytest-dev/execnet/actions?query=workflow%3Abuild
16+
.. image:: https://github.com/pytest-dev/execnet/workflows/test/badge.svg
17+
:target: https://github.com/pytest-dev/execnet/actions?query=workflow%3Atest
1818

1919
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
2020
:target: https://github.com/python/black
@@ -30,7 +30,7 @@ a minimal and fast API targeting the following uses:
3030
* write scripts to administer multiple hosts
3131

3232
Features
33-
------------------
33+
--------
3434

3535
* zero-install bootstrapping: no remote installation required!
3636

RELEASING.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ To publish a new release ``X.Y.Z``, the steps are as follows:
2626

2727
#. Update the ``CHANGELOG.rst`` file with the new release information.
2828

29-
#. Commit and push the branch for review.
29+
#. Commit and push the branch to ``upstream`` and open a PR.
3030

31-
#. Once PR is **green** and **approved**, create and push a tag::
31+
#. Once the PR is **green** and **approved**, start the ``deploy`` workflow manually from the branch ``release-VERSION``, passing ``VERSION`` as parameter.
3232

33-
$ export VERSION=X.Y.Z
34-
$ git tag v$VERSION release-$VERSION
35-
$ git push [email protected]:pytest-dev/execnet.git v$VERSION
36-
37-
That will build the package and publish it on ``PyPI`` automatically.
33+
#. Merge the release PR to ``master``.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "hatchling.build"
99
name = "execnet"
1010
dynamic = ["version"]
1111
description = "execnet: rapid multi-Python deployment"
12-
long_description_file = "README.rst"
12+
readme = {"file" = "README.rst", "content-type" = "text/x-rst"}
1313
license = "MIT"
1414
requires-python = ">=3.7"
1515
authors = [
@@ -49,11 +49,11 @@ Homepage = "https://execnet.readthedocs.io/en/latest/"
4949
source = "vcs"
5050

5151
[tool.hatch.build.hooks.vcs]
52-
version-file = "execnet/_version.py"
52+
version-file = "src/execnet/_version.py"
5353

5454
[tool.hatch.build.targets.sdist]
5555
include = [
56-
"/execnet",
56+
"/src/execnet",
5757
]
5858

5959

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)