Skip to content

Commit 0fac60a

Browse files
authored
Change CircleCI tests to use cached lockfile (#353)
* Change CircleCI tests to use cached lockfile * Fix config * Add circleci lock file * Do not use python version for cache key * Add import test for client install matrix * Update README.md * Just use the regular lock file
1 parent 173552a commit 0fac60a

File tree

3 files changed

+3893
-35
lines changed

3 files changed

+3893
-35
lines changed

.circleci/config.yml

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
version: 2.1
44
orbs:
55
slack: circleci/slack@4.4.2
6-
python: circleci/python@2.0.3
6+
python: circleci/python@2.1.0
77

88
jobs:
99
build_test:
@@ -23,18 +23,17 @@ jobs:
2323
apt-get -y install curl libgeos-dev
2424
pip install --upgrade pip
2525
pip install poetry
26-
- run:
27-
name: Install Python Dependencies
28-
command: |
29-
poetry install
26+
- python/install-packages:
27+
pkg-manager: poetry
28+
include-python-in-cache-key: false
3029
- run:
3130
name: Test Imports (extras need to be guarded!)
3231
command: | # Make sure that importing works without extras installed
3332
poetry run python -c 'import nucleus'
34-
- run:
35-
name: Install Extra Python Dependencies
36-
command: | # install dependencies
37-
poetry install -E metrics -E launch
33+
- python/install-packages:
34+
pkg-manager: poetry
35+
args: -E metrics -E launch
36+
include-python-in-cache-key: false
3837
- run:
3938
name: Black Formatting Check # Only validation, without re-formatting
4039
command: |
@@ -110,24 +109,6 @@ jobs:
110109
exit 1
111110
fi
112111
poetry publish --username=$PYPI_USERNAME --password=$PYPI_PASSWORD
113-
test_poetry_installation:
114-
parameters:
115-
python_version:
116-
type: string
117-
docker:
118-
- image: cimg/python:<<parameters.python_version>>
119-
steps:
120-
- checkout
121-
- run:
122-
command: |
123-
pip install --upgrade pip
124-
name: Upgrade pip
125-
- python/install-packages:
126-
pkg-manager: poetry
127-
- run:
128-
command: |
129-
poetry run python -c 'import nucleus'
130-
name: Test import nucleus
131112
test_client_installation:
132113
parameters:
133114
python_version:
@@ -145,10 +126,29 @@ jobs:
145126
poetry build
146127
name: Build the package
147128
- run:
129+
name: Install - no extras
148130
command: |
149131
export FOUND_PKG=$(find ./dist -name "*.tar.gz")
150132
pip install $FOUND_PKG
151-
name: Install with Python Version
133+
python -c 'import nucleus'
134+
- run:
135+
name: Install with extra metrics
136+
command: |
137+
export FOUND_PKG=$(find ./dist -name "*.tar.gz")
138+
pip install "$FOUND_PKG[metrics]"
139+
python -c 'import nucleus'
140+
- run:
141+
name: Install with extra launch
142+
command: |
143+
export FOUND_PKG=$(find ./dist -name "*.tar.gz")
144+
pip install "$FOUND_PKG[launch]"
145+
python -c 'import nucleus'
146+
- run:
147+
name: Install with extra launch and metrics
148+
command: |
149+
export FOUND_PKG=$(find ./dist -name "*.tar.gz")
150+
pip install "$FOUND_PKG[metrics, launch]"
151+
python -c 'import nucleus'
152152
workflows:
153153
nightly_build_test:
154154
triggers:
@@ -163,11 +163,6 @@ workflows:
163163
context: Nucleus
164164
installation_matrix:
165165
jobs:
166-
- test_poetry_installation:
167-
matrix:
168-
parameters:
169-
python_version: ['3.6', '3.7', '3.8', '3.9'] #, '3.10'] Need to work out a solution to support dev on 3.10
170-
context: Nucleus
171166
- test_client_installation:
172167
matrix:
173168
parameters:
@@ -188,3 +183,4 @@ workflows:
188183
ignore: /.*/ # Runs for none of the branches
189184
tags:
190185
only: /^v\d+\.\d+\.\d+$/ # Runs only for tags with the format [v1.2.3]
186+

0 commit comments

Comments
 (0)