Skip to content

Commit 0e7b2f1

Browse files
authored
Split package build from testing (#39)
1 parent ba68d16 commit 0e7b2f1

File tree

2 files changed

+52
-13
lines changed

2 files changed

+52
-13
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,53 @@ on: [push, pull_request]
77

88
jobs:
99
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-dotnet@v1
16+
- uses: actions/setup-python@v4
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install build
21+
- name: Build
22+
run: python -m build
23+
- name: Upload source distribution
24+
uses: actions/upload-artifact@v3
25+
with:
26+
name: sdist
27+
path: "dist/*.tar.gz"
28+
if-no-files-found: error
29+
- name: Upload wheel
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: wheel
33+
path: "dist/*.whl"
34+
if-no-files-found: error
35+
36+
test:
1037
runs-on: ${{ matrix.os }}
38+
needs: build
1139
strategy:
1240
matrix:
1341
os: [ubuntu-latest, windows-latest, macos-latest]
1442
python: ['3.10', '3.9', '3.8', '3.7'] # pypy3
1543

1644
steps:
17-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
1846

1947
- name: Setup .NET
2048
uses: actions/setup-dotnet@v1
2149
with:
2250
dotnet-version: '6.0.x'
2351

2452
- name: Set up Python ${{ matrix.python }}
25-
uses: actions/setup-python@v2
53+
uses: actions/setup-python@v4
2654
with:
2755
python-version: ${{ matrix.python }}
2856

29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install pytest cffi
33-
34-
- name: Build
35-
run: |
36-
pip install -e .
37-
3857
- name: Cache Mono
3958
if: runner.os == 'Windows'
4059
uses: actions/cache@v2
@@ -47,6 +66,22 @@ jobs:
4766
run: |
4867
choco install -y mono ${{ matrix.python == 'pypy3' && '--x86' || '' }}
4968
69+
- name: Install dependencies
70+
run: |
71+
python -m pip install --upgrade pip
72+
pip install pytest
73+
74+
- name: Download wheel
75+
uses: actions/download-artifact@v3
76+
with:
77+
name: wheel
78+
path: dist/
79+
80+
- name: Install wheel
81+
shell: bash
82+
run: |
83+
pip install dist/*.whl
84+
5085
- name: Test with pytest
5186
run: |
5287
pytest

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[build-system]
2-
requires = ["setuptools>=61", "wheel"]
2+
requires = ["setuptools>=61", "setuptools_scm[toml]", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "clr_loader"
77
description = "Generic pure Python loader for .NET runtimes"
88
license = {text = "MIT"}
9-
version = "0.2.3"
9+
requires-python = ">=3.7"
1010

1111
readme = "README.md"
1212

@@ -22,6 +22,8 @@ classifiers = [
2222
"Operating System :: MacOS :: MacOS X",
2323
]
2424

25+
dynamic = ["version"]
26+
2527
[[project.authors]]
2628
name = "Benedikt Reinartz"
2729
@@ -37,6 +39,8 @@ package-data = {"clr_loader.ffi" = ["dlls/x86/*.dll", "dlls/amd64/*.dll"]}
3739
[tool.setuptools.packages.find]
3840
include = ["clr_loader*"]
3941

42+
[tool.setuptools_scm]
43+
4044
[tool.pytest.ini_options]
4145
xfail_strict = true
4246
testpaths = [

0 commit comments

Comments
 (0)