Skip to content

Commit

Permalink
Merge pull request #127 from templateflow/fix/pypi-deployment
Browse files Browse the repository at this point in the history
MAINT: Revise failing Pypi deployment and ``twine check``
  • Loading branch information
oesteban authored Mar 18, 2024
2 parents 60fc775 + a302bc7 commit 57ad001
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
51 changes: 28 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
tests:
docker:
- image: cimg/python:3.9
- image: cimg/python:3.11
auth:
username: $DOCKER_USER
password: $DOCKER_PAT
Expand All @@ -20,18 +20,18 @@ jobs:
- restore_cache:
keys:
- deps-v10-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
- deps-v10-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
- deps-v10-
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
- deps-v11-
- run:
name: Prepare environment
command: |
python -m venv /tmp/venv
source /tmp/venv/bin/activate
pip install -U pip
pip install -r /tmp/src/templateflow/dev-requirements.txt
pip install datalad
pip install -U build hatch hatchling nipreps-versions build twine codecov
python -m pip install -U pip
python -m pip install -r /tmp/src/templateflow/dev-requirements.txt
python -m pip install datalad
python -m pip install -U build hatch twine pkginfo codecov
- run:
name: Install git and git-annex
Expand All @@ -50,11 +50,19 @@ jobs:
git config --global user.email "email@domain.com"
- save_cache:
key: deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
key: deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
paths:
- "/tmp/cache"
- "/tmp/venv"

- run:
name: Test packaging
command: |
source /tmp/venv/bin/activate
cd /tmp/src/templateflow
python -m build
python -m twine check dist/*
- run:
name: Run tests (w/ DataLad)
command: |
Expand Down Expand Up @@ -120,14 +128,6 @@ jobs:
- store_test_results:
path: /tmp/tests

- run:
name: Test packaging
command: |
source /tmp/venv/bin/activate
cd /tmp/src/templateflow
python -m build
twine check dist/*
build_docs:
machine:
# https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928
Expand Down Expand Up @@ -190,20 +190,25 @@ jobs:
- checkout:
path: /tmp/src/templateflow

- run:
name: Generate requirements.txt
command: |
python /tmp/src/templateflow/.maint/update_requirements.py
- restore_cache:
keys:
- deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v10-
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
- deps-v11-

- run:
name: Deploy to PyPi
command: |
source /tmp/venv/bin/activate
pip install build twine
python -m pip install build -U twine pkginfo
python -m build
twine check dist/*
twine upload dist/*
python -m twine check dist/*
python -m twine upload dist/*
workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: |
python -m venv /tmp/buildenv
source /tmp/buildenv/bin/activate
python -m pip install -U build hatch hatchling nipreps-versions
python -m pip install -U build hatch
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG=${GITHUB_REF##*/}
fi
Expand Down

0 comments on commit 57ad001

Please sign in to comment.