-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIVIS-2325] DEP upgrade to Python 3.12, update dependency versions (#94
) * DEP use python 3.12, update dependency versions * TST drop legacy test for numpy not using mkl * MAINT update changelog * DEP refresh req files for requests * TST set up test suite * MAINT add github templates * TST close file object properly * TST run test suite in verbose mode
- Loading branch information
1 parent
3b879f4
commit 40f88cb
Showing
10 changed files
with
130 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,17 @@ | ||
version: 2 | ||
version: 2.1 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/python:3.7.0 | ||
- image: cimg/python:3.12 | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Build container | ||
command: docker build -t ds-python . | ||
command: docker build --target test -t ds-python . | ||
- run: | ||
name: Verify build completed | ||
command: docker run ds-python /bin/bash -c "echo BUILDS OK" | ||
- run: | ||
name: Check that scipy links to OpenBLAS | ||
command: docker run ds-python python -c "from scipy.linalg import _fblas" | ||
- run: | ||
name: Check that numpy imports from bash shell | ||
command: docker run -t ds-python /bin/bash -c "python -c 'import numpy'" | ||
- run: | ||
name: Verify that numpy does not link to MKL | ||
command: docker run ds-python python -c "from numpy.distutils import system_info; assert system_info.get_info('mkl') == {}" | ||
- run: | ||
name: Validate compatability of civis-python with other packages | ||
command: docker run ds-python /bin/bash -c "python -c 'import civis'" | ||
- run: | ||
name: Run numpy unit tests | ||
command: docker run ds-python /bin/bash -c 'pip install pytest hypothesis; python -c "import numpy; numpy.test()"' | ||
name: Run tests | ||
command: docker run ds-python /test_image.py -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import re | ||
import unittest | ||
|
||
|
||
class TestImage(unittest.TestCase): | ||
|
||
def test_version(self): | ||
version_in_env_var = os.getenv("VERSION") | ||
major = os.getenv("VERSION_MAJOR") | ||
minor = os.getenv("VERSION_MINOR") | ||
micro = os.getenv("VERSION_MICRO") | ||
self.assertTrue(major.isdigit()) | ||
self.assertTrue(minor.isdigit()) | ||
self.assertTrue(micro.isdigit()) | ||
self.assertEqual(version_in_env_var, f"{major}.{minor}.{micro}") | ||
|
||
with open("CHANGELOG.md") as changelog: | ||
version_in_changelog = re.search( | ||
r"##\s+\[(\d+\.\d+\.\d+)]", changelog.read() | ||
).groups()[0] | ||
self.assertEqual(version_in_changelog, version_in_env_var) | ||
|
||
def test_scipy_links_to_openblas(self): | ||
from scipy.linalg import _fblas # noqa: F401 | ||
|
||
def test_numpy_can_import(self): | ||
import numpy as np # noqa: F401 | ||
|
||
def test_civis_can_import(self): | ||
import civis # noqa: F401 | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: General | ||
about: Ask a question, report a potential issue, etc. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Note:** Civis employees should _not_ use the GitHub Issues feature at the public "civis-python" codebase | ||
to file a ticket, and should instead use the internal ticketing system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
|
||
--- | ||
|
||
- [ ] (For Civis employees only) Reference to a relevant ticket in the pull request title | ||
- [ ] Changelog entry added to `CHANGELOG.md` at the repo's root level | ||
- [ ] Description of change in the pull request description | ||
- [ ] If applicable, unit tests have been added and/or updated | ||
- [ ] The CircleCI builds have all passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.11.4-bookworm | ||
FROM python:3.12.3-slim AS production | ||
|
||
LABEL maintainer = [email protected] | ||
|
||
|
@@ -35,7 +35,14 @@ RUN pip install -r requirements-full.txt && \ | |
# https://github.com/joblib/joblib/blob/0.11/joblib/parallel.py#L328L342 | ||
ENV JOBLIB_TEMP_FOLDER=/tmp | ||
|
||
ENV VERSION=7.0.0 \ | ||
ENV VERSION=7.1.0 \ | ||
VERSION_MAJOR=7 \ | ||
VERSION_MINOR=0 \ | ||
VERSION_MINOR=1 \ | ||
VERSION_MICRO=0 | ||
|
||
FROM production AS test | ||
COPY .circleci/test_image.py . | ||
COPY CHANGELOG.md . | ||
|
||
# Defaults to production as the final stage | ||
FROM production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
pip install pip-tools | ||
pip-compile --output-file=requirements-full.txt --pip-args='--prefer-binary' requirements-core.txt | ||
python --version | ||
pip install --upgrade pip-tools | ||
pip-compile --output-file=requirements-full.txt --pip-args='--prefer-binary' --strip-extras --upgrade requirements-core.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
awscli==1.29.5 | ||
boto3==1.28.5 | ||
civis==1.16.1 | ||
numpy==1.25.1 | ||
pandas==2.0.3 | ||
requests==2.31.0 | ||
scikit-learn==1.3.0 | ||
scipy==1.11.1 | ||
awscli==1.32.109 | ||
boto3==1.34.109 | ||
civis==2.0.0 | ||
numpy==1.26.4 | ||
pandas==2.2.2 | ||
requests==2.32.2 | ||
scikit-learn==1.5.0 | ||
scipy==1.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters