Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
Mapbox peer dependency (#113)
Browse files Browse the repository at this point in the history
* Add pre-commit safety check

* Update packages for security reasons

* Code linting/formatting adheres to gitignore

* Trigger rebuild

* Upgrade safety

* Try safety as a main dep

* Use external deps for pre-commit

* Final go, before we start ignoring safety warnings

* Try removing `py`

* Fix README

* Fix references to ruamel.yaml using dot . instead of hyphen - for package name

See python-poetry/poetry#109 (comment)

* Use latest poetry package to avoid setuptools bug

* Re-add mapbox as a dev dependency to fix build step

* Update version number

* Be a bit more lenient in testing third party APIs, as we can't be sure of the coordinates they'll return

* Fix test syntax

* Fix test syntax

* Simplify tests for postcodes API
  • Loading branch information
janbaykara authored Nov 10, 2022
1 parent 2bd8aa7 commit 485405a
Show file tree
Hide file tree
Showing 12 changed files with 669 additions and 259 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
deploy-docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb
# Workaround for: https://github.com/actions/checkout/issues/211
options: --user 1001
volumes:
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/cache@v2
with:
path: /home/runner/docker/.cache/poetry
key: do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f-poetry-${{ hashFiles('poetry.lock') }}
key: do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb-poetry-${{ hashFiles('poetry.lock') }}
- run: make install
- run: make lint
- run: make deploy-docs
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
lint-and-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb
# Workaround for: https://github.com/actions/checkout/issues/211
options: --user 1001
volumes:
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/cache@v2
with:
path: /home/runner/docker/.cache/poetry
key: do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f-poetry-${{ hashFiles('poetry.lock') }}
key: do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb-poetry-${{ hashFiles('poetry.lock') }}
- run: make install
- run: make ci
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
release:
runs-on: ubuntu-latest
container:
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb
# Workaround for: https://github.com/actions/checkout/issues/211
options: --user 1001
volumes:
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: actions/cache@v2
with:
path: /home/runner/docker/.cache/poetry
key: do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f-poetry-${{ hashFiles('poetry.lock') }}
key: do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb-poetry-${{ hashFiles('poetry.lock') }}
- run: make install
- run: chmod +x .github/bin/wait-for-it.sh
- run: .github/bin/wait-for-it.sh db:5432
Expand Down
21 changes: 12 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,32 @@ repos:
- id: end-of-file-fixer
exclude: LICENSE

- repo: local
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
hooks:
# Upgrade outdated python syntax
- id: pyupgrade
name: pyupgrade
entry: poetry run pyupgrade --py38-plus
entry: pyupgrade --py38-plus
types: [python]
language: system
language: python

- repo: local
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
# Sort ordering of python imports
- id: isort
name: isort
entry: poetry run isort --settings-path pyproject.toml
entry: isort --settings-path pyproject.toml
types: [python]
language: system
language: python

- repo: local
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
# Run code formatting on python code
- id: black
name: black
entry: poetry run black --config pyproject.toml
entry: black --config pyproject.toml
types: [python]
language: system
language: python
143 changes: 143 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,146 @@ node_modules
*.html
docs/api
docs/components

# .gitignore include
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# JS
node_modules

# Local
local.py

# Docs artifacts
docs/api
docs/components

.DS_Store
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bootstrap: install pre-commit-install migrate
.PHONY: codestyle
codestyle:
poetry run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
poetry run isort --settings-path pyproject.toml ./
poetry run isort --gitignore --settings-path pyproject.toml ./
poetry run black --config pyproject.toml ./
yarn prettier --write .

Expand Down Expand Up @@ -74,7 +74,7 @@ test:

.PHONY: check-codestyle
check-codestyle:
poetry run isort --diff --check-only --settings-path pyproject.toml ./
poetry run isort --gitignore --diff --check-only --settings-path pyproject.toml ./
poetry run black --diff --check --config pyproject.toml ./
poetry run darglint --docstring-style google --verbosity 2 groundwork
yarn tsc --noemit
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

An integrated Django and Javascript framework for people who build tools for organisers.

For more information, check out [the documentation site](https://groundwork.commonknowledge.coop/).
For more information, check out [the documentation](https://groundwork.commonknowledge.coop/).

Work on this project kindly supported by [Rosa-Luxemburg-Stiftung](https://www.rosalux.de).
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "groundwork-django",
"version": "0.1.6",
"version": "0.2.0",
"repository": "https://github.com/commonknowledge/groundwork.git",
"description": "An integrated Django and Javascript framework for people who build tools for organisers.",
"author": "Common Knowledge <[email protected]>",
Expand Down Expand Up @@ -29,6 +29,7 @@
"babel-preset-vite": "^1.0.4",
"es-module-lexer": "^0.9.3",
"jest": "^27.3.1",
"mapbox-gl": "^2.6.0",
"mutationobserver-shim": "^0.3.7",
"prettier": "^2.4.1",
"ts-jest": "^27.0.7",
Expand Down
Loading

0 comments on commit 485405a

Please sign in to comment.