Skip to content

Commit

Permalink
Upgrade Python dependencies
Browse files Browse the repository at this point in the history
* Upgrade pre-commit dependencies
* Remove pyvcr
* Add Makefile for compiling Python requirements
* Rename codecov configuration file
* Add flake8 configuration file
* Update CI workflow
* Replace TmpDir helper with pytest fixtures
  • Loading branch information
replaceafill authored Nov 22, 2023
1 parent 84759b3 commit 44b6775
Show file tree
Hide file tree
Showing 51 changed files with 1,480 additions and 15,899 deletions.
File renamed without changes.
16 changes: 16 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[flake8]
exclude = .tox, .git, __pycache__, .cache, build, dist, *.pyc, *.egg-info, .eggs
# Error codes:
# - https://flake8.pycqa.org/en/latest/user/error-codes.html
# - https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
# - https://github.com/PyCQA/flake8-bugbear#list-of-warnings
#
# E203: whitespace before `,`, `;` or `:`
# E402: module level import not at top of file
# E501: line too long
# W503: line break before binary operator
ignore =
E203,
E402,
E501,
W503
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ on:
branches:
- "master"
jobs:
tox:
test:
name: "Test Python ${{ matrix.python-version }}"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
python-version: [
"3.8",
Expand Down Expand Up @@ -53,6 +54,10 @@ jobs:
uses: "actions/setup-python@v4"
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
requirements.txt
requirements-dev.txt
- name: "Install tox"
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.10.0
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: "23.7.0"
rev: "23.11.0"
hooks:
- id: black
args: [--safe, --quiet]
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DEFAULT_GOAL := help

.PHONY: pip-compile pip-upgrade

pip-compile: ## Compile pip requirements
pip-compile --allow-unsafe --output-file=requirements.txt requirements.in
pip-compile --allow-unsafe --output-file=requirements-dev.txt requirements-dev.in

pip-upgrade: ## Upgrade pip requirements
pip-compile --allow-unsafe --upgrade --output-file=requirements.txt requirements.in
pip-compile --allow-unsafe --upgrade --output-file=requirements-dev.txt requirements-dev.in

help: ## Print this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
1 change: 1 addition & 0 deletions aips/create_dip.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def extract_aip(aip_file, aip_uuid, tmp_dir):
pass

# Find extracted entry. Assuming it contains the AIP UUID
extracted_entry = ""
for entry in os.listdir(tmp_dir):
if aip_uuid in entry:
extracted_entry = os.path.join(tmp_dir, entry)
Expand Down
Binary file added fixtures/aip.7z
Binary file not shown.
Binary file added fixtures/aip.tar
Binary file not shown.
Binary file added fixtures/avalon-aip.tar
Binary file not shown.
27 changes: 0 additions & 27 deletions fixtures/vcr_cassettes/test_atom_upload_deposit_fail.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions fixtures/vcr_cassettes/test_atom_upload_deposit_success.yaml

This file was deleted.

Loading

0 comments on commit 44b6775

Please sign in to comment.