Skip to content

Commit

Permalink
Merge pull request #85 from Remi-Gau/prep_release
Browse files Browse the repository at this point in the history
[MNT] prepare for pypi release
  • Loading branch information
Remi-Gau authored Dec 8, 2022
2 parents edfbd12 + 423e406 commit 9586e01
Show file tree
Hide file tree
Showing 21 changed files with 269 additions and 188 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check_md_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Markdown links

# checking for any dead links in markdown files

on:
push:
branches:
- main
pull_request:
branches: ['*']

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
# config-file: '.github/workflows/mlc_config.json'
59 changes: 59 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Packaging

on:
push:
branches:
- main
tags:
- '*'

defaults:
run:
shell: bash

jobs:
package:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

# Build packages and upload
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: "3.9"

steps:

- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install build
run: python -m pip install build

- name: Build sdist and wheel
run: python -m build

- name: Test PyPI upload
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Upload to PyPI (on tags)
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
8 changes: 6 additions & 2 deletions .github/workflows/test_and_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ on:
pull_request:
branches: [ "*" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test_and_coverage:

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

steps:

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ "*" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test_demo:

Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ repos:
- id: flake8
exclude: tests_.*.py|version.*.py|setup.py # ignore tests and versioneer related code


- repo: https://github.com/ikamensh/flynt/
rev: "0.77"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ formats:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
version: "3.8"
install:
- method: pip
path: .
Expand Down
25 changes: 13 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"makefile.extensionOutputFolder": "./.vscode",
"cSpell.words": [
"bidsmreye",
"bidsname",
"bidsutils",
"coregister",
"coregistration",
"eyemask",
"filefolder"
],
"autoDocstring.docstringFormat": "sphinx",
"esbonio.sphinx.confDir": ""
"makefile.extensionOutputFolder": "./.vscode",
"cSpell.words": [
"bidsmreye",
"bidsname",
"bidsutils",
"coregister",
"coregistration",
"eyemask",
"filefolder"
],
"autoDocstring.docstringFormat": "sphinx",
"esbonio.sphinx.confDir": "",
"githubPullRequests.ignoredPullRequestBranches": ["main"]
}
115 changes: 30 additions & 85 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
- [Submit Feedback](#submit-feedback)
- [Get Started!](#get-started)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Tips](#tips)
- [Deploying](#deploying)
- [Docker recipe](#docker-recipe)

# CONTRIBUTING

Contributions are welcome, and they are greatly appreciated!
Every little bit helps, and credit will always be given.
Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

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

If you are reporting a bug, please include:

- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.

### Fix Bugs

Look through the GitHub issues for bugs.
Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.

### Implement Features

Look through the GitHub issues for features.
Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.

### Write Documentation

bidsMReye could always use more documentation,
whether as part of the official bidsMReye docs, in docstrings,
or even on the web in blog posts, articles, and such.
bidsMReye could always use more documentation, whether as part of the official
bidsMReye docs, in docstrings, or even on the web in blog posts, articles, and
such.

### Submit Feedback

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

If you are proposing a feature:

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

## Get Started!

Expand All @@ -67,12 +66,15 @@ Ready to contribute? Here's how to set up `bidsmreye` for local development.
git clone git@github.com:your_name_here/bidsmreye.git
```

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

```bash
mkvirtualenv bidsmreye
cd bidsmreye/
python setup.py develop
pip install -e .[dev]
```
```
1. Create a branch for local development:
Expand All @@ -87,9 +89,8 @@ Now you can make your changes locally.
tests, including testing other Python versions with tox:

```bash
flake8 bidsmreye tests
python setup.py test or pytest
tox
make lint
make test
```

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

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
2. If the pull request adds functionality, the docs should be updated. Put your
new functionality into a function with a docstring, and add the feature to
the list in README.rst.
3. The pull request should work for Python 3.8, and for PyPy. Check
https://travis-ci.com/Remi-Gau/bidsmreye/pull_requests
and make sure that the tests pass for all supported Python versions.

## Tips

To run a subset of tests:

```bash
pytest tests.test_bidsmreye
```

## Deploying

A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).

Then run

```bash
bump2version patch # possible: major / minor / patch
git push
git push --tags
```

Travis will then deploy to PyPI if tests pass.

## Docker recipe

Made using neurodocker

```bash
docker run --rm repronim/neurodocker:0.7.0 generate docker \
--base debian:bullseye-slim \
--pkg-manager apt \
--install "git wget" \
--miniconda \
version="latest" \
create_env="deepmreye" \
conda_install="python=3.7 pip" \
pip_install="git+https://github.com/DeepMReye/DeepMReye.git" \
activate="true" \
--run "mkdir -p /inputs/models" \
--run "wget https://osf.io/cqf74/download -O /inputs/models/dataset1_guided_fixations.h5" \
--output Dockerfile
```

Build image

```bash
docker build --tag deepmreye:0.1.0 --file Dockerfile .
```

Run it

```bash
docker run -it --rm \
deepmreye:0.1.0
```
https://github.com/cpp-lln-lab/bidsMReye/actions and make sure that the
tests pass for all supported Python versions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ clean-test: ## remove test and coverage artifacts

## INSTALL

install: clean ## install the package to the active Python's site-packages
pip install .
make models

install_dev: clean ## install the package and development dependencies to the active Python's site-packages
pip install -e .[dev]
make models
Expand Down Expand Up @@ -215,7 +211,7 @@ docker/Dockerfile: ## Dockerfile for the bidsmreye docker image
--base debian:stretch-slim \
--pkg-manager apt \
--install "git wget" \
--run "mkdir -p /home/neuro/bidsMReye" \
--run "mkdir -p /home/neuro/bidsMReye/models" \
--workdir /home/neuro/bidsMReye \
--run "wget -q https://osf.io/download/cqf74/ -O models/dataset1_guided_fixations.h5" \
--run "wget -q https://osf.io/download/4f6m7/ -O models/dataset2_pursuit.h5" \
Expand All @@ -236,7 +232,7 @@ docker/Dockerfile: ## Dockerfile for the bidsmreye docker image
docker_build: docker/Dockerfile
docker build --tag cpplab/bidsmreye:latest --file docker/Dockerfile .

docker/Dockerfile_dev: ## Dockerfile for the bidsmreye docker image using local pacakge
docker/Dockerfile_dev: ## Dockerfile for the bidsmreye docker image using local package
docker run --rm repronim/neurodocker:0.7.0 generate docker \
--base debian:stretch-slim \
--pkg-manager apt \
Expand Down
Loading

0 comments on commit 9586e01

Please sign in to comment.