Skip to content

Commit d85f040

Browse files
authored
Fix workflow, numpy install, and pytest bug in github action workflows (#117)
* Update pyproject.toml * Update python-package-conda.yml * Update python-package-conda.yml * Update python-package-conda.yml * Update python-package-conda.yml * Update python-package-conda.yml * Update python-package-conda.yml * Update python-package-conda.yml
1 parent 4b7ed56 commit d85f040

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

.github/workflows/python-package-conda.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,19 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@v4
13-
- name: Set up Python 3.10
14-
uses: actions/setup-python@v3
13+
14+
- name: Install Miniconda
15+
uses: conda-incubator/setup-miniconda@v2
1516
with:
16-
python-version: '3.10'
17-
- name: Add conda to system path
17+
auto-update-conda: true
18+
python-version: 3.11
19+
environment-name: test
20+
21+
- name: Install dependencies
1822
run: |
19-
# $CONDA is an environment variable pointing to the root of the miniconda directory
20-
echo $CONDA/bin >> $GITHUB_PATH
21-
- name: Install current library and dependencies
22-
run: |
23-
pip install -e .
24-
# - name: Lint with flake8
25-
# run: |
26-
# conda install flake8
27-
# # stop the build if there are Python syntax errors or undefined names
28-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30-
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31-
- name: Test with pytest
23+
conda install -n test numpy=1.26 pytest pip
24+
conda run -n test pip install -e .
25+
26+
- name: Run tests
3227
run: |
33-
conda install pytest
34-
pytest
28+
conda run -n test pytest

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
build-backend = "setuptools.build_meta"
2+
requires = [
3+
"setuptools>=61.0", # default
4+
"wheel", # also often needed
5+
"numpy>=1.19.5" # add numpy here for build-time use
6+
]
7+
build-backend = "setuptools.build_meta" # using setuptool building engine
48

59
[project]
610
name = "ngclearn"

0 commit comments

Comments
 (0)