Skip to content

Commit 96eca19

Browse files
authored
Python 3.12 upgrade (#6)
* minor cleanup * replace setup.py with pyproject.toml * Add github workflows * linting fixes * fix: license declaraction * run django-upgrade * add pull request template * fix: bandit findings * refactor test entrypoint * switch back to keyvaluestore * fix testing command in ci * bump version * update readme.md
1 parent b3030e6 commit 96eca19

27 files changed

+1005
-174
lines changed

.editorconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Defines the coding style for different editors and IDEs.
2+
# http://editorconfig.org
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Rules for source code.
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
insert_final_newline = true
12+
indent_size = 2
13+
indent_style = space
14+
trim_trailing_whitespace = true
15+
16+
# Rules for Python code.
17+
[*.py]
18+
indent_size = 4
19+
20+
# Rules for markdown documents.
21+
[*.md]
22+
indent_size = 4
23+
trim_trailing_whitespace = false
24+
25+
# Rules for makefile
26+
[Makefile]
27+
indent_style = tab
28+
indent_size = 4

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Summary
2+
- Write a quick summary of what this PR is for
3+
4+
5+
##### Related Links
6+
- Paste link to ticket or any other related sites here
7+
8+
##### Ready for QA Checklist
9+
- [ ] Code Review
10+
- [ ] Dev QA
11+
- [ ] Rebase and Squash

.github/workflows/validate.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
- main
9+
- 'release/**'
10+
pull_request:
11+
branches:
12+
- '*'
13+
workflow_dispatch:
14+
15+
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.12"]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip setuptools poetry
30+
poetry install
31+
- name: Linting
32+
run: |
33+
poetry run isort .
34+
poetry run black .
35+
poetry run flake8 . --extend-ignore=D,E501,W601 --extend-exclude=docs/ --statistics --count
36+
- name: Security
37+
run: poetry run bandit -c pyproject.toml -r .
38+
- name: Testing
39+
run: poetry run python ./runtests.py

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
*.py[co]
2+
*.swp
3+
*.bak
4+
5+
# docs
6+
_build
27

38
# Packages
49
*.egg
@@ -8,8 +13,46 @@ build
813
eggs
914
parts
1015
bin
16+
var
17+
sdist
1118
develop-eggs
1219
.installed.cfg
1320

1421
# Installer logs
1522
pip-log.txt
23+
24+
# Unit test / coverage reports
25+
.coverage
26+
.tox
27+
28+
.idea
29+
30+
.DS_Store
31+
32+
#Translations
33+
*.mo
34+
35+
#Mr Developer
36+
.mr.developer.cfg
37+
38+
# Configuration
39+
sdelint.cnf
40+
41+
#generated data
42+
usecases/output.csv
43+
44+
# Test files
45+
info.log
46+
htmlcov/
47+
48+
#ides
49+
.idea
50+
.vscode
51+
52+
#custom cert bundle
53+
my_root_certs.crt
54+
55+
# symbolic links
56+
.flake8
57+
58+
conf/

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/Lucas-C/pre-commit-hooks
3+
rev: v1.1.13
4+
hooks:
5+
- id: forbid-crlf
6+
- id: remove-crlf
7+
- id: forbid-tabs
8+
exclude_types: [csv]
9+
- id: remove-tabs
10+
exclude_types: [csv]
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v4.1.0
14+
hooks:
15+
- id: trailing-whitespace
16+
- id: end-of-file-fixer
17+
- id: check-merge-conflict
18+
- id: check-yaml
19+
args: [--unsafe]
20+
21+
- repo: https://github.com/pre-commit/mirrors-isort
22+
rev: v5.10.1
23+
hooks:
24+
- id: isort
25+
26+
- repo: https://github.com/ambv/black
27+
rev: 22.3.0
28+
hooks:
29+
- id: black
30+
language_version: python3.12
31+
32+
- repo: https://github.com/pycqa/flake8
33+
rev: 3.9.2
34+
hooks:
35+
- id: flake8
36+
additional_dependencies: [flake8-typing-imports==1.10.0]
37+
exclude: ^tests
38+

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

CODEOWNERS

Lines changed: 0 additions & 4 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
lint:
2-
find . -name '*.py' | xargs flake8 --ignore=E501,W601
2+
poetry run flake8 . --extend-ignore=D,E501,W601 --extend-exclude=docs/ --statistics --count
33

44
test:
5-
(cd testing; python manage.py test)
5+
poetry run python ./runtests.py

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# django-keyvaluestore
2+
3+
django-keyvaluestore implements a very simple database-based key-value store for Django.
4+
5+
This package is a fork and only maintained on an as needed basis since the upstream package is no longer maintained at - https://github.com/vikingco/django-keyvaluestore.
6+
7+
## Install
8+
9+
```bash
10+
pip install git+https://github.com/sdelements/django-keyvaluestore@master
11+
```
12+
13+
## Usage
14+
15+
The interface is straightforward::
16+
17+
```python
18+
from keyvaluestore import get_value_for_key, set_key_value
19+
set_key_value('foo', 'bar')
20+
get_value_for_key('foo')
21+
```

README.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)