Skip to content

Commit

Permalink
Merge pull request #10 from JoKra1/main
Browse files Browse the repository at this point in the history
v0.1.3
  • Loading branch information
JoKra1 authored Mar 12, 2024
2 parents 8b6b714 + 130e51d commit baa9f1c
Show file tree
Hide file tree
Showing 18 changed files with 2,958 additions and 827 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,38 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl

test-coverage:
# Runs tests for one build for which coverage is computed as well
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python for Coverage
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest ./tests --cov=mssm --cov-report=xml --cov-report=html
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

# Also store coverage as artifact
- uses: actions/upload-artifact@v3
with:
name: coverage
path: |
coverage.xml
./htmlcov/index.html
release:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
Expand All @@ -70,6 +101,7 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: ./wheelhouse/

- name: Create GitHub Release
Expand All @@ -86,15 +118,14 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' ./wheelhouse/artifact/**
'${{ github.ref_name }}' ./wheelhouse/**
--repo '${{ github.repository }}'
publish-test:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# test pypi now gets all un-tagged pushes
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# Publish to test-pypi - only if release is triggered.
needs:
- build
- release
runs-on: ubuntu-latest

environment:
Expand All @@ -108,12 +139,16 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: ./wheelhouse/

- name: Print wheel content
run: ls ./wheelhouse

- name: Publish wheels to test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./wheelhouse/artifact
packages-dir: ./wheelhouse/
repository-url: https://test.pypi.org/legacy/

publish-release:
Expand All @@ -134,9 +169,10 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: ./wheelhouse/

- name: Publish wheels to test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./wheelhouse/artifact
packages-dir: ./wheelhouse/
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ pip install mssm
pip install matplotlib # Only needed for tutorials
```

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:

```
pip install -i https://test.pypi.org/simple/ mssm
```
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.

### Building from source

Expand All @@ -43,4 +39,4 @@ pip install .

## Contributing

Contributions are welcome! Feel free to open issues or make pull-requests to main.
Contributions are welcome! Feel free to open issues or make pull-requests to main. Some problems that could use work are listed below.
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ requires = [
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
before-test = "ls"
test-skip = "*-win32 pp* *i686"
test-requires = ["pytest", "pytest-cov"]
test-command = "pytest {project}/tests --cov={project}"

[project]
dependencies=["numpy >= 1.24.1",
"pandas >= 1.5.3",
"scipy >= 1.10.0"]
"scipy >= 1.10.0",
"tqdm >= 4.66.1"]
name = "mssm"
authors = [
{ name="Joshua Krause", email="jokra001@proton.me" }
Expand All @@ -27,4 +34,4 @@ dynamic = ["version"]

[tool.setuptools_scm]
# https://github.com/pypa/setuptools_scm/issues/342
local_scheme = "no-local-version"
local_scheme = "no-local-version"
Loading

0 comments on commit baa9f1c

Please sign in to comment.