Skip to content

Commit 57ad001

Browse files
authored
Merge pull request #127 from templateflow/fix/pypi-deployment
MAINT: Revise failing Pypi deployment and ``twine check``
2 parents 60fc775 + a302bc7 commit 57ad001

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

.circleci/config.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
tests:
44
docker:
5-
- image: cimg/python:3.9
5+
- image: cimg/python:3.11
66
auth:
77
username: $DOCKER_USER
88
password: $DOCKER_PAT
@@ -20,18 +20,18 @@ jobs:
2020
2121
- restore_cache:
2222
keys:
23-
- deps-v10-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
24-
- deps-v10-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
25-
- deps-v10-
23+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
24+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
25+
- deps-v11-
2626
- run:
2727
name: Prepare environment
2828
command: |
2929
python -m venv /tmp/venv
3030
source /tmp/venv/bin/activate
31-
pip install -U pip
32-
pip install -r /tmp/src/templateflow/dev-requirements.txt
33-
pip install datalad
34-
pip install -U build hatch hatchling nipreps-versions build twine codecov
31+
python -m pip install -U pip
32+
python -m pip install -r /tmp/src/templateflow/dev-requirements.txt
33+
python -m pip install datalad
34+
python -m pip install -U build hatch twine pkginfo codecov
3535
3636
- run:
3737
name: Install git and git-annex
@@ -50,11 +50,19 @@ jobs:
5050
git config --global user.email "[email protected]"
5151
5252
- save_cache:
53-
key: deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
53+
key: deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
5454
paths:
5555
- "/tmp/cache"
5656
- "/tmp/venv"
5757

58+
- run:
59+
name: Test packaging
60+
command: |
61+
source /tmp/venv/bin/activate
62+
cd /tmp/src/templateflow
63+
python -m build
64+
python -m twine check dist/*
65+
5866
- run:
5967
name: Run tests (w/ DataLad)
6068
command: |
@@ -120,14 +128,6 @@ jobs:
120128
- store_test_results:
121129
path: /tmp/tests
122130

123-
- run:
124-
name: Test packaging
125-
command: |
126-
source /tmp/venv/bin/activate
127-
cd /tmp/src/templateflow
128-
python -m build
129-
twine check dist/*
130-
131131
build_docs:
132132
machine:
133133
# https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928
@@ -190,20 +190,25 @@ jobs:
190190
- checkout:
191191
path: /tmp/src/templateflow
192192

193+
- run:
194+
name: Generate requirements.txt
195+
command: |
196+
python /tmp/src/templateflow/.maint/update_requirements.py
197+
193198
- restore_cache:
194199
keys:
195-
- deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
196-
- deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
197-
- deps-v10-
200+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
201+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
202+
- deps-v11-
198203

199204
- run:
200205
name: Deploy to PyPi
201206
command: |
202207
source /tmp/venv/bin/activate
203-
pip install build twine
208+
python -m pip install build -U twine pkginfo
204209
python -m build
205-
twine check dist/*
206-
twine upload dist/*
210+
python -m twine check dist/*
211+
python -m twine upload dist/*
207212
208213
workflows:
209214
version: 2

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: |
5050
python -m venv /tmp/buildenv
5151
source /tmp/buildenv/bin/activate
52-
python -m pip install -U build hatch hatchling nipreps-versions
52+
python -m pip install -U build hatch
5353
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
5454
TAG=${GITHUB_REF##*/}
5555
fi

0 commit comments

Comments
 (0)