Skip to content

Commit 2bfbdb9

Browse files
committed
Skip testpypi upload for meta package.
1 parent 91f54d5 commit 2bfbdb9

File tree

3 files changed

+15
-37
lines changed

3 files changed

+15
-37
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,6 @@ on:
66
branches: [master]
77

88
jobs:
9-
sphinx:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v2
13-
- name: Setup python 3.10
14-
uses: actions/setup-python@v2
15-
with:
16-
python-version: "3.10"
17-
- name: Cache Python dependencies
18-
uses: actions/cache@v2
19-
with:
20-
path: ~/.cache/pip
21-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/3.10.txt') }}
22-
restore-keys: |
23-
${{ runner.os }}-pip-
24-
${{ runner.os }}-
25-
- name: Install Python dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install wheel
29-
pip install -r requirements/3.10.txt
30-
- name: Build documentation
31-
run: sphinx-build -nW . docs/_build
32-
- name: Run doctests
33-
run: sphinx-build -b doctest . docs/_build
34-
359
build:
3610
strategy:
3711
fail-fast: false
@@ -41,7 +15,7 @@ jobs:
4115
- "3.8"
4216
- "3.9"
4317
- "3.10"
44-
test-component:
18+
component:
4519
- arangodb
4620
- azurite
4721
- clickhouse
@@ -85,7 +59,7 @@ jobs:
8559
pip install --upgrade pip
8660
pip install -r requirements/${{ matrix.python-version }}.txt
8761
- name: Run docker diagnostics
88-
if: matrix.test-component == 'core'
62+
if: matrix.component == 'core'
8963
run: |
9064
echo "Build minimal container for docker-in-docker diagnostics"
9165
docker build -f Dockerfile.diagnostics -t testcontainers-python .
@@ -96,13 +70,13 @@ jobs:
9670
echo "Container diagnostics with host network"
9771
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --network=host testcontainers-python python diagnostics.py
9872
- name: Lint the code
99-
run: make ${{ matrix.test-component }}/lint
73+
run: make ${{ matrix.component }}/lint
10074
- name: Run tests
101-
if: matrix.test-component != 'meta'
102-
run: make ${{ matrix.test-component }}/tests
75+
if: matrix.component != 'meta'
76+
run: make ${{ matrix.component }}/tests
10377
- name: Build the package
104-
run: make ${{ matrix.test-component }}/dist
105-
- name: Publish the package to pypi
78+
run: make ${{ matrix.component }}/dist
79+
- name: Upload the package to pypi
10680
if: >
10781
github.event_name == 'push'
10882
&& github.ref == 'refs/heads/master'
@@ -111,5 +85,4 @@ jobs:
11185
env:
11286
TWINE_USERNAME: __token__
11387
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
114-
TWINE_REPOSITORY: pypi
115-
run: make ${{ matrix.test-component }}/publish
88+
run: make ${{ matrix.component }}/upload

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ venv
7171

7272
.DS_Store
7373
.python-version
74+
.env

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ PYTHON_VERSION ?= 3.10
33
IMAGE = testcontainers-python:${PYTHON_VERSION}
44
REQUIREMENTS = $(addprefix requirements/,${PYTHON_VERSIONS:=.txt})
55
RUN = docker run --rm -it
6-
TWINE_REPOSITORY ?= testpypi
76
# Get all directories that contain a setup.py and get the directory name.
87
PACKAGES = $(subst /,,$(dir $(wildcard */setup.py)))
98

@@ -34,8 +33,13 @@ ${LINT} : %/lint :
3433
flake8 $*
3534

3635
# Targets to publish packages.
36+
upload : ${UPLOAD}
3737
${UPLOAD} : %/upload :
38-
twine upload --non-interactive --repository=${TWINE_REPOSITORY} --skip-existing $*/dist/*
38+
if [ ${TWINE_REPOSITORY}-$* = testpypi-meta ]; then \
39+
echo "Cannot upload meta package to testpypi because of missing permissions."; \
40+
else \
41+
twine upload --non-interactive --skip-existing $*/dist/*; \
42+
fi
3943

4044
# Targets to build docker images
4145
image: requirements/${PYTHON_VERSION}.txt

0 commit comments

Comments
 (0)