Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.8 #258

Merged
merged 5 commits into from
Dec 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2
jobs:
style-check:
docker:
- image: circleci/python:3.7
- image: circleci/python:3.8

working_directory: ~/repo

Expand All @@ -20,9 +20,9 @@ jobs:
python -m flake8 --show-source signac/


test-3.7: &test-template
test-3.8: &test-template
docker:
- image: circleci/python:3.7
- image: circleci/python:3.8

environment:
PYTHON: python
Expand All @@ -35,11 +35,11 @@ jobs:

- restore_cache:
keys:
- python-env-v4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-dev.txt" }}
- python-env-v4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}
- python-env-v4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- python-env-v4-{{ arch }}
- python-env-v4
- python-env-v5-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-dev.txt" }}
- python-env-v5-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}
- python-env-v5-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- python-env-v5-{{ arch }}
- python-env-v5

- run:
name: install dependencies
Expand All @@ -59,18 +59,23 @@ jobs:
${PYTHON} -m pip install -U -e . -r requirements-dev.txt

- save_cache:
key: python-env-v4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-dev.txt" }}
key: python-env-v5-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-dev.txt" }}
paths:
- "venv"

- run:
name: run tests
command: |
. venv/bin/activate
${PYTHON} -m coverage run -m unittest discover tests/ -v
${PYTHON} -m pip install python-rapidjson==0.7.1 && coverage run -m unittest discover tests/ -v
${PYTHON} -m coverage report -i
codecov
if [ $(python -c "import sys; print(sys.version_info.minor)") -lt 8 ]; then
${PYTHON} -m coverage run -m unittest discover tests/ -v
${PYTHON} -m pip install python-rapidjson==0.9.1 && coverage run -m unittest discover tests/ -v
${PYTHON} -m coverage report -i
codecov
else
${PYTHON} -m unittest discover tests/ -v
${PYTHON} -m pip install python-rapidjson==0.9.1 && ${PYTHON} -m unittest discover tests/ -v
fi

- store_artifacts:
path: test-reports
Expand All @@ -88,6 +93,10 @@ jobs:
git checkout "${CIRCLE_SHA1}" -- benchmark.py # ensure that we use the same benchmark script
${PYTHON} benchmark.py run -N 100 1000 --force
${PYTHON} benchmark.py compare origin/master "${CIRCLE_SHA1}"
test-3.7:
<<: *test-template
docker:
- image: circleci/python:3.7
test-3.6:
<<: *test-template
docker:
Expand All @@ -106,7 +115,7 @@ jobs:

check-metadata:
docker:
- image: circleci/python:3.7
- image: circleci/python:3.8
working_directory: ~/repo
steps:
- checkout
Expand All @@ -122,7 +131,7 @@ jobs:

test-deploy-pypi:
docker:
- image: circleci/python:3.7
- image: circleci/python:3.8
working_directory: ~/repo
steps:
- checkout
Expand All @@ -134,7 +143,7 @@ jobs:

deploy-pypi:
docker:
- image: circleci/python:3.7
- image: circleci/python:3.8
working_directory: ~/repo
steps:
- checkout
Expand All @@ -159,6 +168,9 @@ workflows:
- test-3.7:
requires:
- style-check
- test-3.8:
requires:
- style-check
- test-pypy-3:
requires:
- test-3.6
Expand All @@ -174,6 +186,7 @@ workflows:
- test-3.5
- test-3.6
- test-3.7
- test-3.8
- test-pypy-3
deploy:
jobs:
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Added

- Add properties ``Project.id`` and ``Job.id`` (#250).
- Add function to initialize a sample data space for testing purposes.
- Official support for Python 3.8.

Changed
+++++++
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
6 changes: 5 additions & 1 deletion tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ def test_no_workspace_warn_on_find(self):
self.assertFalse(os.path.exists(self.project.workspace()))
with self.assertLogs(level='INFO') as cm:
list(self.project.find_jobs())
self.assertEqual(len(cm.output), 2)
# Python < 3.8 will return 2 messages.
# Python >= 3.8 will return 3 messages, because it determines the
# length of the project one additional time during the list
# constructor: https://bugs.python.org/issue33234
self.assertIn(len(cm.output), (2, 3))

def test_workspace_broken_link_error_on_find(self):
wd = self.project.workspace()
Expand Down