Skip to content

Commit

Permalink
Python 3.12 & Django 4.2 upgrade (#97)
Browse files Browse the repository at this point in the history
* structural changes
* update readme
* django upgrade fixes
* change workflow to use make
* merge with django-see-profile
* drop deprecated middlewares
  • Loading branch information
SunnyR authored Jun 7, 2024
1 parent ae16f98 commit 6162b6e
Show file tree
Hide file tree
Showing 48 changed files with 2,034 additions and 1,559 deletions.
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Defines the coding style for different editors and IDEs.
# http://editorconfig.org

# top-most EditorConfig file
root = true

# Rules for source code.
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
trim_trailing_whitespace = true

# Rules for Python code.
[*.py]
indent_size = 4

# Rules for markdown documents.
[*.md]
indent_size = 4
trim_trailing_whitespace = false

# Rules for makefile
[Makefile]
indent_style = tab
indent_size = 4
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Summary
- Write a quick summary of what this PR is for


##### Related Links
- Paste link to ticket or any other related sites here

##### Ready for QA Checklist
- [ ] Code Review
- [ ] Dev QA
- [ ] Rebase and Squash
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools poetry tox-gh-actions
poetry install
- name: Build wheels and source tarball
run: poetry build
- name: publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
37 changes: 37 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate

on:
push:
branches:
- develop
- master
- main
- 'release/**'
pull_request:
branches:
- '*'
workflow_dispatch:

jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools poetry
poetry install
- name: Linting
run: |
make lint
- name: Security
run: make bandit
- name: Testing
run: make tests
66 changes: 50 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,58 @@
# python compiled files
*.pyc
*.pyo
*.egg-info

# back up files from VIM / Emacs
*~
*.py[co]
*.swp
*.bak

# ignore setup.py build dir
build/
# docs
_build

# ignore sphinx built documentation
_build/
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# ignore tox files
.tox/
# Installer logs
pip-log.txt

# ignore coverage files
# Unit test / coverage reports
.coverage
.tox

.idea

.DS_Store

#Translations
*.mo

#Mr Developer
.mr.developer.cfg

# Configuration
sdelint.cnf

#generated data
usecases/output.csv

# Test files
info.log
htmlcov/

# development tools
.vscode/
#ides
.idea
.vscode

#custom cert bundle
my_root_certs.crt

# symbolic links
.flake8

conf/
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
exclude_types: [csv]
- id: remove-tabs
exclude_types: [csv]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-yaml
args: [--unsafe]

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort

- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.12

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.10.0]
exclude: ^tests

19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,14 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

lint:
poetry run black .
poetry run isort .
poetry run flake8 . --extend-ignore=D,E501,W601 --extend-exclude=docs/,**/migrations/*,tests/ --statistics --count

bandit:
poetry run bandit -c pyproject.toml -r .

test:
poetry run python ./runtests.py
Loading

0 comments on commit 6162b6e

Please sign in to comment.