-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIVIS-2326] MAINT update repo setup and packaging (#57)
* MAINT switch to pyproject.toml, add support for python 3.12, drop python 3.8 * MAINT setup_remote_docker * MAINT update ci config and add github templates * FIX include dotfiles in setuptools.package-data * REF refactor legacy python code
- Loading branch information
1 parent
450943e
commit 7030306
Showing
55 changed files
with
842 additions
and
744 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,98 +1,43 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
pre-build: | ||
description: A check that doesn't need every supported Python version (e.g., code style checks) | ||
parameters: | ||
command-run: | ||
type: string | ||
build: | ||
docker: | ||
# Pick the highest Python 3.x version that this project is known to support | ||
- image: cimg/python:3.11 | ||
# Pick the latest released Python 3.x version from https://circleci.com/developer/images/image/cimg/python | ||
- image: cimg/python:3.12 | ||
steps: | ||
- checkout | ||
- run: | ||
working_directory: ~/project/ | ||
command: << parameters.command-run >> | ||
|
||
build-python: | ||
parameters: | ||
python-version: | ||
type: string | ||
docker: | ||
- image: cimg/python:<< parameters.python-version >> | ||
steps: | ||
- checkout | ||
name: Install the full development requirements | ||
command: | | ||
pip install --progress-bar off -e ".[dev]" && \ | ||
pip list -v | ||
- run: | ||
# Test that we can build a source distribution that can correctly | ||
# install from clean slate. | ||
name: Build source distribution and install package from it | ||
working_directory: ~/project/ | ||
name: bandit | ||
command: | | ||
pip install --progress-bar off --upgrade pip setuptools build && \ | ||
python -m build && \ | ||
pip install dist/`ls dist/ | grep .whl` | ||
bandit --version && \ | ||
bandit -r src -x tests | ||
- run: | ||
name: Install the full development requirements | ||
working_directory: ~/project/ | ||
command: pip install --progress-bar off -r dev-requirements.txt | ||
name: black | ||
command: | | ||
black --check src tests | ||
- run: | ||
name: Show installed Python packages | ||
command: pip list -v | ||
name: flake8 | ||
command: | | ||
flake8 src tests | ||
- run: | ||
name: Run python tests | ||
working_directory: ~/ | ||
# Avoid being able to import the package by relative import. | ||
# Test code by importing the *installed* package in site-packages. | ||
name: pip-audit | ||
command: | | ||
pytest -vv --durations=0 --junitxml=/tmp/testxml/report.xml project/civis_jupyter_notebooks | ||
- store_test_results: | ||
path: /tmp/testxml/ | ||
- setup_remote_docker | ||
pip-audit --version && \ | ||
pip-audit --skip-editable | ||
- run: | ||
name: Test Docker image build | ||
working_directory: ~/project/ | ||
name: Build and check the source distribution and wheel | ||
command: | | ||
if [ << parameters.python-version >> = 3.11 ] | ||
then | ||
./tests/run_docker_tests.sh tests/Dockerfile | ||
fi | ||
workflows: | ||
version: 2 | ||
build-and-test: | ||
jobs: | ||
- pre-build: | ||
name: flake8 | ||
command-run: | | ||
pip install -r dev-requirements.txt && \ | ||
flake8 civis_jupyter_notebooks | ||
- pre-build: | ||
name: twine | ||
command-run: | | ||
pip install --upgrade twine build && \ | ||
python -m build && \ | ||
twine check dist/`ls dist/ | grep .tar.gz` && \ | ||
twine check dist/`ls dist/ | grep .whl` | ||
- pre-build: | ||
name: safety | ||
command-run: | | ||
pip install -e . && \ | ||
pip install --upgrade safety && \ | ||
safety --version && \ | ||
safety check | ||
- pre-build: | ||
name: bandit | ||
command-run: | | ||
pip install --upgrade bandit && \ | ||
bandit --version && \ | ||
bandit -r civis_jupyter_notebooks -x civis_jupyter_notebooks/tests | ||
- build-python: | ||
requires: | ||
- flake8 | ||
- twine | ||
- safety | ||
- bandit | ||
matrix: | ||
parameters: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
python -m build && \ | ||
twine check dist/`ls dist/ | grep .tar.gz` && \ | ||
twine check dist/`ls dist/ | grep .whl` | ||
- run: | ||
name: Run python tests | ||
command: pytest --durations=0 --junitxml=/tmp/testxml/report.xml | ||
- store_test_results: | ||
path: /tmp/testxml/ |
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,2 +1,3 @@ | ||
[flake8] | ||
max-line-length = 125 | ||
max-line-length = 88 | ||
extend-ignore = E203 |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.