Skip to content

Commit 9586e01

Browse files
authored
Merge pull request #85 from Remi-Gau/prep_release
[MNT] prepare for pypi release
2 parents edfbd12 + 423e406 commit 9586e01

21 files changed

+269
-188
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Markdown links
2+
3+
# checking for any dead links in markdown files
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches: ['*']
11+
12+
jobs:
13+
markdown-link-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@master
17+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
18+
with:
19+
use-quiet-mode: 'yes'
20+
use-verbose-mode: 'yes'
21+
# config-file: '.github/workflows/mlc_config.json'

.github/workflows/package.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Packaging
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
package:
16+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
17+
18+
# Build packages and upload
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
include:
23+
- os: ubuntu-latest
24+
python-version: "3.9"
25+
26+
steps:
27+
28+
- uses: actions/checkout@v3
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Display Python version
39+
run: python -c "import sys; print(sys.version)"
40+
41+
- name: Install build
42+
run: python -m pip install build
43+
44+
- name: Build sdist and wheel
45+
run: python -m build
46+
47+
- name: Test PyPI upload
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
user: __token__
51+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
52+
repository_url: https://test.pypi.org/legacy/
53+
skip_existing: true
54+
55+
- name: Upload to PyPI (on tags)
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
user: __token__
59+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test_and_coverage.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ on:
66
pull_request:
77
branches: [ "*" ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test_and_coverage:
1115

1216
runs-on: ${{ matrix.os }}
1317
strategy:
1418
matrix:
15-
os: [macos-latest, ubuntu-latest]
16-
python-version: ['3.8', '3.9']
19+
os: [ubuntu-latest, macOS-latest] # windows-latest: does not work because antspyx is not available for windows
20+
python-version: ["3.8", "3.9", "3.10"] # '3.11' : some dependencies are not yet available for python 3.11
1721

1822
steps:
1923

.github/workflows/test_demo.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [ "*" ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test_demo:
1115

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ repos:
2121
- id: flake8
2222
exclude: tests_.*.py|version.*.py|setup.py # ignore tests and versioneer related code
2323

24-
2524
- repo: https://github.com/ikamensh/flynt/
2625
rev: "0.77"
2726
hooks:

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ formats:
1717

1818
# Optionally set the version of Python and requirements required to build your docs
1919
python:
20-
version: 3.8
20+
version: "3.8"
2121
install:
2222
- method: pip
2323
path: .

.vscode/settings.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
2-
"makefile.extensionOutputFolder": "./.vscode",
3-
"cSpell.words": [
4-
"bidsmreye",
5-
"bidsname",
6-
"bidsutils",
7-
"coregister",
8-
"coregistration",
9-
"eyemask",
10-
"filefolder"
11-
],
12-
"autoDocstring.docstringFormat": "sphinx",
13-
"esbonio.sphinx.confDir": ""
2+
"makefile.extensionOutputFolder": "./.vscode",
3+
"cSpell.words": [
4+
"bidsmreye",
5+
"bidsname",
6+
"bidsutils",
7+
"coregister",
8+
"coregistration",
9+
"eyemask",
10+
"filefolder"
11+
],
12+
"autoDocstring.docstringFormat": "sphinx",
13+
"esbonio.sphinx.confDir": "",
14+
"githubPullRequests.ignoredPullRequestBranches": ["main"]
1415
}

CONTRIBUTING.md

Lines changed: 30 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
- [Submit Feedback](#submit-feedback)
88
- [Get Started!](#get-started)
99
- [Pull Request Guidelines](#pull-request-guidelines)
10-
- [Tips](#tips)
11-
- [Deploying](#deploying)
12-
- [Docker recipe](#docker-recipe)
1310

1411
# CONTRIBUTING
1512

16-
Contributions are welcome, and they are greatly appreciated!
17-
Every little bit helps, and credit will always be given.
13+
Contributions are welcome, and they are greatly appreciated! Every little bit
14+
helps, and credit will always be given.
1815

1916
You can contribute in many ways:
2017

@@ -26,35 +23,37 @@ Report bugs at https://github.com/cpp-lln-lab/bidsmreye/issues.
2623

2724
If you are reporting a bug, please include:
2825

29-
- Your operating system name and version.
30-
- Any details about your local setup that might be helpful in troubleshooting.
31-
- Detailed steps to reproduce the bug.
26+
- Your operating system name and version.
27+
- Any details about your local setup that might be helpful in troubleshooting.
28+
- Detailed steps to reproduce the bug.
3229

3330
### Fix Bugs
3431

35-
Look through the GitHub issues for bugs.
36-
Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
32+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
33+
wanted" is open to whoever wants to implement it.
3734

3835
### Implement Features
3936

40-
Look through the GitHub issues for features.
41-
Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
37+
Look through the GitHub issues for features. Anything tagged with "enhancement"
38+
and "help wanted" is open to whoever wants to implement it.
4239

4340
### Write Documentation
4441

45-
bidsMReye could always use more documentation,
46-
whether as part of the official bidsMReye docs, in docstrings,
47-
or even on the web in blog posts, articles, and such.
42+
bidsMReye could always use more documentation, whether as part of the official
43+
bidsMReye docs, in docstrings, or even on the web in blog posts, articles, and
44+
such.
4845

4946
### Submit Feedback
5047

51-
The best way to send feedback is to file an issue at https://github.com/cpp-lln-lab/bidsmreye/issues.
48+
The best way to send feedback is to file an issue at
49+
https://github.com/cpp-lln-lab/bidsmreye/issues.
5250

5351
If you are proposing a feature:
5452

55-
- Explain in detail how it would work.
56-
- Keep the scope as narrow as possible, to make it easier to implement.
57-
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
53+
- Explain in detail how it would work.
54+
- Keep the scope as narrow as possible, to make it easier to implement.
55+
- Remember that this is a volunteer-driven project, and that contributions are
56+
welcome :)
5857

5958
## Get Started!
6059

@@ -67,12 +66,15 @@ Ready to contribute? Here's how to set up `bidsmreye` for local development.
6766
git clone [email protected]:your_name_here/bidsmreye.git
6867
```
6968

70-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
69+
3. Install your local copy into a virtualenv. Assuming you have
70+
virtualenvwrapper installed, this is how you set up your fork for local
71+
development:
7172

7273
```bash
7374
mkvirtualenv bidsmreye
7475
cd bidsmreye/
75-
python setup.py develop
76+
pip install -e .[dev]
77+
```
7678
```
7779
7880
1. Create a branch for local development:
@@ -87,9 +89,8 @@ Now you can make your changes locally.
8789
tests, including testing other Python versions with tox:
8890

8991
```bash
90-
flake8 bidsmreye tests
91-
python setup.py test or pytest
92-
tox
92+
make lint
93+
make test
9394
```
9495

9596
To get flake8 and tox, just pip install them into your virtualenv.
@@ -109,65 +110,9 @@ git push origin name-of-your-bugfix-or-feature
109110
Before you submit a pull request, check that it meets these guidelines:
110111

111112
1. The pull request should include tests.
112-
2. If the pull request adds functionality, the docs should be updated. Put
113-
your new functionality into a function with a docstring, and add the
114-
feature to the list in README.rst.
113+
2. If the pull request adds functionality, the docs should be updated. Put your
114+
new functionality into a function with a docstring, and add the feature to
115+
the list in README.rst.
115116
3. The pull request should work for Python 3.8, and for PyPy. Check
116-
https://travis-ci.com/Remi-Gau/bidsmreye/pull_requests
117-
and make sure that the tests pass for all supported Python versions.
118-
119-
## Tips
120-
121-
To run a subset of tests:
122-
123-
```bash
124-
pytest tests.test_bidsmreye
125-
```
126-
127-
## Deploying
128-
129-
A reminder for the maintainers on how to deploy.
130-
Make sure all your changes are committed (including an entry in HISTORY.rst).
131-
132-
Then run
133-
134-
```bash
135-
bump2version patch # possible: major / minor / patch
136-
git push
137-
git push --tags
138-
```
139-
140-
Travis will then deploy to PyPI if tests pass.
141-
142-
## Docker recipe
143-
144-
Made using neurodocker
145-
146-
```bash
147-
docker run --rm repronim/neurodocker:0.7.0 generate docker \
148-
--base debian:bullseye-slim \
149-
--pkg-manager apt \
150-
--install "git wget" \
151-
--miniconda \
152-
version="latest" \
153-
create_env="deepmreye" \
154-
conda_install="python=3.7 pip" \
155-
pip_install="git+https://github.com/DeepMReye/DeepMReye.git" \
156-
activate="true" \
157-
--run "mkdir -p /inputs/models" \
158-
--run "wget https://osf.io/cqf74/download -O /inputs/models/dataset1_guided_fixations.h5" \
159-
--output Dockerfile
160-
```
161-
162-
Build image
163-
164-
```bash
165-
docker build --tag deepmreye:0.1.0 --file Dockerfile .
166-
```
167-
168-
Run it
169-
170-
```bash
171-
docker run -it --rm \
172-
deepmreye:0.1.0
173-
```
117+
https://github.com/cpp-lln-lab/bidsMReye/actions and make sure that the
118+
tests pass for all supported Python versions.

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ clean-test: ## remove test and coverage artifacts
5050

5151
## INSTALL
5252

53-
install: clean ## install the package to the active Python's site-packages
54-
pip install .
55-
make models
56-
5753
install_dev: clean ## install the package and development dependencies to the active Python's site-packages
5854
pip install -e .[dev]
5955
make models
@@ -215,7 +211,7 @@ docker/Dockerfile: ## Dockerfile for the bidsmreye docker image
215211
--base debian:stretch-slim \
216212
--pkg-manager apt \
217213
--install "git wget" \
218-
--run "mkdir -p /home/neuro/bidsMReye" \
214+
--run "mkdir -p /home/neuro/bidsMReye/models" \
219215
--workdir /home/neuro/bidsMReye \
220216
--run "wget -q https://osf.io/download/cqf74/ -O models/dataset1_guided_fixations.h5" \
221217
--run "wget -q https://osf.io/download/4f6m7/ -O models/dataset2_pursuit.h5" \
@@ -236,7 +232,7 @@ docker/Dockerfile: ## Dockerfile for the bidsmreye docker image
236232
docker_build: docker/Dockerfile
237233
docker build --tag cpplab/bidsmreye:latest --file docker/Dockerfile .
238234

239-
docker/Dockerfile_dev: ## Dockerfile for the bidsmreye docker image using local pacakge
235+
docker/Dockerfile_dev: ## Dockerfile for the bidsmreye docker image using local package
240236
docker run --rm repronim/neurodocker:0.7.0 generate docker \
241237
--base debian:stretch-slim \
242238
--pkg-manager apt \

0 commit comments

Comments
 (0)