Skip to content

Commit 885fa52

Browse files
committed
Update GitHub Action workflows and pre-commit config
1 parent 15a60b8 commit 885fa52

4 files changed

Lines changed: 53 additions & 35 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,62 @@
1-
name: release
2-
3-
on: push
1+
name: Release 🚀
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*"
9+
pull_request:
10+
branches:
11+
- main
412

513
jobs:
614
build:
7-
name: Build distribution 📦
15+
name: Build distribution 👷
816
runs-on: ubuntu-latest
917

1018
steps:
11-
- uses: actions/checkout@v6
19+
- name: Checkout repo 🛎️
20+
uses: actions/checkout@v6
1221
with:
1322
persist-credentials: false
1423

15-
- name: Set up Python
24+
- name: Set up Python 🐍
1625
uses: actions/setup-python@v6
1726
with:
1827
python-version: "3.x"
1928

20-
- name: Install build
29+
- name: Install build 🧱
2130
run: python3 -m pip install build --user
2231

23-
- name: Build a binary wheel and a source tarball
32+
- name: Build a binary wheel and a source tarball 🛠️
2433
run: python3 -m build
2534

26-
- name: Store the distribution packages
35+
- name: Store the distribution packages 📤
2736
uses: actions/upload-artifact@v5
2837
with:
2938
name: python-package-distributions
3039
path: dist/
3140

3241
publish:
33-
name: Publish Python 🐍 distribution 📦 to PyPI
42+
name: Publish distribution to PyPI 📦
3443
if: startsWith(github.ref, 'refs/tags/')
35-
36-
needs:
37-
- build
38-
44+
needs: build
3945
runs-on: ubuntu-latest
46+
4047
environment:
4148
name: pypi
4249
url: https://pypi.org/p/django-datacite
4350

4451
permissions:
4552
id-token: write
4653

47-
steps:
48-
- name: Download all the dists
54+
steps:
55+
- name: Download the distribution packages 📥
4956
uses: actions/download-artifact@v6
5057
with:
5158
name: python-package-distributions
5259
path: dist/
5360

54-
- name: Publish distribution 📦 to PyPI
61+
- name: Publish to PyPI 🚀
5562
uses: pypa/gh-action-pypi-publish@release/v1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
name: pytest
1+
name: Test 🧪
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*"
9+
pull_request:
10+
branches:
11+
- main
412

513
jobs:
614
pytest:
7-
runs-on: ubuntu-22.04
15+
name: Run pytest 🧪
16+
runs-on: ubuntu-latest
817

918
strategy:
1019
matrix:
11-
python-version: ['3.8', '3.12']
20+
python-version: ['3.8', '3.14']
1221

1322
services:
1423
postgres:
@@ -24,32 +33,33 @@ jobs:
2433
--health-retries 5
2534
2635
steps:
27-
- uses: actions/checkout@v6
36+
- name: Checkout repo 🛎️
37+
uses: actions/checkout@v6
2838
with:
2939
persist-credentials: false
3040

31-
- name: Set up Python ${{ matrix.python-version }}
41+
- name: Set up Python ${{ matrix.python-version }} 🐍
3242
uses: actions/setup-python@v6
3343
with:
3444
python-version: ${{ matrix.python-version }}
3545

36-
- name: Install package
46+
- name: Install package 📦
3747
run: |
3848
python3 -m pip install --upgrade pip setuptools
3949
python3 -m pip install psycopg2-binary
4050
python3 -m pip install -e .
4151
python3 -m pip install -e .[pytest]
4252
43-
- name: Setup environment file
53+
- name: Setup environment file 🔐
4454
run: |
4555
echo "SECRET_KEY=thisisnotaverysecretkey" >> $GITHUB_ENV
4656
echo "DATABASE=postgresql://postgres:postgres_password@localhost/django_datacite" >> $GITHUB_ENV
4757
48-
- name: Run pytest
58+
- name: Run pytest 🧪
4959
run: |
5060
pytest --cov
5161
52-
- name: Run coveralls
62+
- name: Run coveralls 📊
5363
uses: coverallsapp/github-action@v2
5464
with:
5565
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -59,10 +69,11 @@ jobs:
5969
coveralls:
6070
needs: pytest
6171
runs-on: ubuntu-latest
72+
6273
steps:
63-
- name: Run coveralls finish
74+
- name: Run coveralls finish 🏁
6475
uses: coverallsapp/github-action@v2
6576
with:
6677
github-token: ${{ secrets.GITHUB_TOKEN }}
6778
parallel-finished: true
68-
carryforward: "3.7,3.11"
79+
carryforward: "3.7,3.14"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ repos:
55
hooks:
66
- id: check-hooks-apply
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
8+
rev: v6.0.0
99
hooks:
1010
- id: check-ast
1111
- id: end-of-file-fixer
1212
- id: trailing-whitespace
1313
- id: debug-statements
1414
- repo: https://github.com/charliermarsh/ruff-pre-commit
15-
rev: v0.0.284
15+
rev: v0.14.14
1616
hooks:
1717
- id: ruff
1818
args: [--fix, --exit-non-zero-on-fix]

django_datacite/imports.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def import_name(name_node):
434434
# update name identifiers
435435
for name_identifier_instance in name_identifier_instances:
436436
try:
437-
name_identifier_instance.name
437+
name_identifier_instance.name # noqa: B018
438438
except Name.DoesNotExist:
439439
name_identifier_instance.name = name_instance
440440
name_identifier_instance.save()
@@ -496,7 +496,7 @@ def import_geo_location(geo_location_node):
496496
if geo_location_point and \
497497
geo_location_point.get('pointLongitude') is not None and \
498498
geo_location_point.get('pointLatitude') is not None:
499-
geo_location_point_instance, created = GeoLocationPoint.objects.update_or_create(
499+
_, created = GeoLocationPoint.objects.update_or_create(
500500
geo_location=geo_location_instance,
501501
defaults={
502502
'point_longitude': geo_location_point.get('pointLongitude'),
@@ -510,7 +510,7 @@ def import_geo_location(geo_location_node):
510510
geo_location_bbox.get('eastBoundLongitude') is not None and \
511511
geo_location_bbox.get('southBoundLatitude') is not None and \
512512
geo_location_bbox.get('northBoundLatitude') is not None:
513-
geo_location_bbox_instance, created = GeoLocationBox.objects.update_or_create(
513+
_, created = GeoLocationBox.objects.update_or_create(
514514
geo_location=geo_location_instance,
515515
defaults={
516516
'west_bound_longitude': geo_location_bbox.get('westBoundLongitude'),
@@ -528,7 +528,7 @@ def import_geo_location(geo_location_node):
528528
[point.get('pointLongitude'), point.get('pointLatitude')]
529529
for point in polygon_points
530530
]
531-
geo_location_polygon_instance, created = GeoLocationPolygon.objects.update_or_create(
531+
_, created = GeoLocationPolygon.objects.update_or_create(
532532
geo_location=geo_location_instance,
533533
polygon_points=polygon_points_json,
534534
in_point_longitude=geo_location_polygon.get('inPolygonPoint', {}).get('pointLongitude'),

0 commit comments

Comments
 (0)