Skip to content

Commit baa9f1c

Browse files
authored
Merge pull request #10 from JoKra1/main
v0.1.3
2 parents 8b6b714 + 130e51d commit baa9f1c

18 files changed

+2958
-827
lines changed

.github/workflows/python-package.yml

+42-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,38 @@ jobs:
4545

4646
- uses: actions/upload-artifact@v3
4747
with:
48+
name: wheels
4849
path: ./wheelhouse/*.whl
50+
51+
test-coverage:
52+
# Runs tests for one build for which coverage is computed as well
53+
needs: build
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Set up Python for Coverage
59+
uses: actions/setup-python@v4
60+
with:
61+
python-version: '3.11'
62+
- name: Install dependencies
63+
run: |
64+
python -m pip install --upgrade pip
65+
pip install .
66+
- name: Test with pytest
67+
run: |
68+
pip install pytest pytest-cov
69+
pytest ./tests --cov=mssm --cov-report=xml --cov-report=html
70+
- name: Upload coverage reports to Codecov with GitHub Action
71+
uses: codecov/codecov-action@v3
72+
73+
# Also store coverage as artifact
74+
- uses: actions/upload-artifact@v3
75+
with:
76+
name: coverage
77+
path: |
78+
coverage.xml
79+
./htmlcov/index.html
4980
5081
release:
5182
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
@@ -70,6 +101,7 @@ jobs:
70101
- name: Download Artifacts
71102
uses: actions/download-artifact@v3
72103
with:
104+
name: wheels
73105
path: ./wheelhouse/
74106

75107
- name: Create GitHub Release
@@ -86,15 +118,14 @@ jobs:
86118
GITHUB_TOKEN: ${{ github.token }}
87119
run: >-
88120
gh release upload
89-
'${{ github.ref_name }}' ./wheelhouse/artifact/**
121+
'${{ github.ref_name }}' ./wheelhouse/**
90122
--repo '${{ github.repository }}'
91123
92124
publish-test:
93125
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
94-
# test pypi now gets all un-tagged pushes
95-
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
126+
# Publish to test-pypi - only if release is triggered.
96127
needs:
97-
- build
128+
- release
98129
runs-on: ubuntu-latest
99130

100131
environment:
@@ -108,12 +139,16 @@ jobs:
108139
- name: Download Artifacts
109140
uses: actions/download-artifact@v3
110141
with:
142+
name: wheels
111143
path: ./wheelhouse/
144+
145+
- name: Print wheel content
146+
run: ls ./wheelhouse
112147

113148
- name: Publish wheels to test-pypi
114149
uses: pypa/gh-action-pypi-publish@release/v1
115150
with:
116-
packages-dir: ./wheelhouse/artifact
151+
packages-dir: ./wheelhouse/
117152
repository-url: https://test.pypi.org/legacy/
118153

119154
publish-release:
@@ -134,9 +169,10 @@ jobs:
134169
- name: Download Artifacts
135170
uses: actions/download-artifact@v3
136171
with:
172+
name: wheels
137173
path: ./wheelhouse/
138174

139175
- name: Publish wheels to test-pypi
140176
uses: pypa/gh-action-pypi-publish@release/v1
141177
with:
142-
packages-dir: ./wheelhouse/artifact
178+
packages-dir: ./wheelhouse/

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ pip install mssm
2020
pip install matplotlib # Only needed for tutorials
2121
```
2222

23-
The fourth line, installing ``matplotlib`` is only necessary if you want to run the tutorials. Note: pypi will only reflect releases (Basically, the state of the stable branch). Pushes to main continue to be distributed to test.pypi, so if you need the latest changes you can get them from [test.pypi](https://test.pypi.org/project/mssm/#description). In that case, you need to replace the third line in the code above with:
24-
25-
```
26-
pip install -i https://test.pypi.org/simple/ mssm
27-
```
23+
The fourth line, installing ``matplotlib`` is only necessary if you want to run the tutorials. Note: pypi will only reflect releases (Basically, the state of the stable branch). If you urgently need a feature currently only available on the main branch, consider building from source.
2824

2925
### Building from source
3026

@@ -43,4 +39,4 @@ pip install .
4339

4440
## Contributing
4541

46-
Contributions are welcome! Feel free to open issues or make pull-requests to main.
42+
Contributions are welcome! Feel free to open issues or make pull-requests to main. Some problems that could use work are listed below.

pyproject.toml

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ requires = [
77
]
88
build-backend = "setuptools.build_meta"
99

10+
[tool.cibuildwheel]
11+
before-test = "ls"
12+
test-skip = "*-win32 pp* *i686"
13+
test-requires = ["pytest", "pytest-cov"]
14+
test-command = "pytest {project}/tests --cov={project}"
15+
1016
[project]
1117
dependencies=["numpy >= 1.24.1",
1218
"pandas >= 1.5.3",
13-
"scipy >= 1.10.0"]
19+
"scipy >= 1.10.0",
20+
"tqdm >= 4.66.1"]
1421
name = "mssm"
1522
authors = [
1623
{ name="Joshua Krause", email="jokra001@proton.me" }
@@ -27,4 +34,4 @@ dynamic = ["version"]
2734

2835
[tool.setuptools_scm]
2936
# https://github.com/pypa/setuptools_scm/issues/342
30-
local_scheme = "no-local-version"
37+
local_scheme = "no-local-version"

0 commit comments

Comments
 (0)