forked from newsapps/django-boundaryservice
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from opennorth/upgrade
Upgrade Python and Django
- Loading branch information
Showing
65 changed files
with
698 additions
and
478 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,35 @@ | ||
# The pull_request_target workflow trigger is dangerous. Do not add unrelated logic to this workflow. | ||
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target | ||
name: Auto-merge | ||
on: pull_request_target | ||
permissions: | ||
pull-requests: write # to approve the PR | ||
contents: write # to merge the PR | ||
jobs: | ||
dependabot: | ||
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' || steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr review --approve ${{ github.event.pull_request.html_url }} | ||
- if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' || steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} | ||
precommit: | ||
if: ${{ github.event.pull_request.user.login == 'pre-commit-ci[bot]' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr review --approve ${{ github.event.pull_request.html_url }} | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} |
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,44 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] | ||
django-version: ['Django>=3.2,<4', 'Django>=4.2,<5'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
cache-dependency-path: setup.cfg | ||
# https://docs.djangoproject.com/en/4.2/ref/contrib/gis/install/geolibs/ | ||
- run: | | ||
sudo apt update | ||
sudo apt install binutils libproj-dev gdal-bin | ||
- run: pip install .[test] '${{ matrix.django-version }}' psycopg2-binary | ||
- env: | ||
PORT: ${{ job.services.postgres.ports[5432] }} | ||
DJANGO_SETTINGS_MODULE: settings | ||
run: env PYTHONPATH=$PYTHONPATH:$PWD django-admin migrate --noinput | ||
- env: | ||
PORT: ${{ job.services.postgres.ports[5432] }} | ||
run: coverage run --source=boundaries runtests.py | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: coveralls --service=github | ||
services: | ||
postgres: | ||
image: postgis/postgis:15-3.4 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432/tcp |
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,15 @@ | ||
name: Lint | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- run: pip install --upgrade check-manifest flake8 isort | ||
- run: flake8 . | ||
- run: isort . | ||
- run: check-manifest --ignore-bad-ideas '*.mo' |
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,22 @@ | ||
name: Publish to PyPI | ||
on: push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- run: pip install --upgrade build | ||
- run: python -m build --sdist --wheel | ||
- name: Publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
- name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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,5 +1,6 @@ | ||
*.pyc | ||
*.egg-info | ||
*_cleaned_* | ||
/build | ||
/dist | ||
/.coverage |
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 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,12 @@ | ||
include CHANGELOG.md | ||
recursive-include boundaries/locale * | ||
recursive-include boundaries/static * | ||
recursive-include boundaries/templates * | ||
recursive-include boundaries/tests *.dbf | ||
recursive-include boundaries/tests *.prj | ||
recursive-include boundaries/tests *.py | ||
recursive-include boundaries/tests *.shp | ||
recursive-include boundaries/tests *.shx | ||
recursive-include boundaries/tests *.txt | ||
recursive-include boundaries/tests *.zip | ||
exclude *.py |
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
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,20 +1,16 @@ | ||
from django.contrib import admin | ||
from django.contrib.gis.admin import OSMGeoAdmin | ||
|
||
from boundaries.models import BoundarySet, Boundary | ||
from boundaries.models import Boundary, BoundarySet | ||
|
||
|
||
@admin.register(BoundarySet) | ||
class BoundarySetAdmin(admin.ModelAdmin): | ||
list_filter = ('authority', 'domain') | ||
|
||
|
||
admin.site.register(BoundarySet, BoundarySetAdmin) | ||
|
||
|
||
@admin.register(Boundary) | ||
class BoundaryAdmin(OSMGeoAdmin): | ||
list_display = ('name', 'external_id', 'set') | ||
list_display_links = ('name', 'external_id') | ||
list_filter = ('set',) | ||
|
||
|
||
admin.site.register(Boundary, BoundaryAdmin) |
Oops, something went wrong.