Skip to content

Commit 41c31f2

Browse files
authored
Merge pull request #101 from alexferl/next
update project, merge PRs
2 parents ee9242e + 1a3b0d1 commit 41c31f2

36 files changed

+701
-1973
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 2
10+
11+
[*.py]
12+
indent_size = 4
13+
14+
[Makefile]
15+
indent_style = tab
16+
indent_size = 4

.github/workflows/test.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
build:
11+
runs-on: '${{ matrix.os }}'
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
python-version: '3.8'
17+
FLASK: 3.0.2
18+
- os: ubuntu-latest
19+
python-version: '3.8'
20+
FLASK: 2.3.3
21+
- os: ubuntu-latest
22+
python-version: '3.8'
23+
FLASK: 2.2.5
24+
- os: ubuntu-latest
25+
python-version: '3.9'
26+
FLASK: 3.0.2
27+
- os: ubuntu-latest
28+
python-version: '3.9'
29+
FLASK: 2.3.3
30+
- os: ubuntu-latest
31+
python-version: '3.9'
32+
FLASK: 2.2.5
33+
- os: ubuntu-latest
34+
python-version: '3.10'
35+
FLASK: 3.0.2
36+
- os: ubuntu-latest
37+
python-version: '3.10'
38+
FLASK: 2.3.3
39+
- os: ubuntu-latest
40+
python-version: '3.10'
41+
FLASK: 2.2.5
42+
- os: ubuntu-latest
43+
python-version: '3.11'
44+
FLASK: 3.0.2
45+
- os: ubuntu-latest
46+
python-version: '3.11'
47+
FLASK: 2.3.3
48+
- os: ubuntu-latest
49+
python-version: '3.11'
50+
FLASK: 2.2.5
51+
- os: ubuntu-latest
52+
python-version: '3.12'
53+
FLASK: 3.0.2
54+
- os: ubuntu-latest
55+
python-version: '3.12'
56+
FLASK: 2.3.3
57+
- os: ubuntu-latest
58+
python-version: '3.12'
59+
FLASK: 2.2.5
60+
steps:
61+
- name: Install apt dependencies
62+
run: |
63+
set -ex
64+
sudo apt update
65+
sudo apt install -y ldap-utils slapd enchant-2 libldap2-dev libsasl2-dev apparmor-utils
66+
- name: Disable AppArmor
67+
run: sudo aa-disable /usr/sbin/slapd
68+
- name: 'Set up Python ${{ matrix.python-version }}'
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: '${{ matrix.python-version }}'
72+
- uses: actions/checkout@v4
73+
- run: pip install pytest Flask==$FLASK
74+
env:
75+
FLASK: '${{ matrix.FLASK }}'
76+
- run: pip install -r requirements-dev.txt .
77+
- run: pip install .
78+
- run: pytest

.pre-commit-config.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
4-
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
7-
- id: mixed-line-ending
8-
args: ['--fix=lf']
9-
description: Forces to replace line ending by the UNIX 'lf' character.
10-
- repo: https://github.com/psf/black
11-
rev: 22.1.0
12-
hooks:
13-
- id: black
14-
language_version: python3
15-
args: [-t, py310]
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: mixed-line-ending
8+
args: ['--fix=lf']
9+
description: Forces to replace line ending by the UNIX 'lf' character.
10+
- repo: https://github.com/psf/black
11+
rev: 24.3.0
12+
hooks:
13+
- id: black
14+
language_version: python3
15+
- repo: https://github.com/d-ryzhykau/pipenv-lock-pre-commit
16+
rev: 0.5.0
17+
hooks:
18+
- id: pipenv-lock
19+
- id: pipenv-verify
20+
- id: pipenv-requirements
21+
- id: pipenv-requirements-dev

.travis.yml

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

AUTHORS

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

Makefile

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,24 @@
1-
.PHONY: help dev clean update test lint pre-commit
2-
3-
VENV_NAME?=venv
4-
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
5-
PYTHON=${VENV_NAME}/bin/python3
1+
.PHONY: help dev test lint pre-commit
62

73
.DEFAULT: help
84
help:
95
@echo "make dev"
10-
@echo " prepare development environment, use only once"
11-
@echo "make clean"
12-
@echo " delete development environment"
13-
@echo "make update"
14-
@echo " update dependencies"
6+
@echo " prepare development environment"
157
@echo "make test"
16-
@echo " run tests"
8+
@echo " run tests"
179
@echo "make lint"
18-
@echo " run black"
10+
@echo " run black"
1911
@echo "make pre-commit"
20-
@echo " run pre-commit hooks"
12+
@echo " run pre-commit hooks"
2113

2214
dev:
23-
make venv
24-
25-
venv: $(VENV_NAME)/bin/activate
26-
$(VENV_NAME)/bin/activate:
27-
test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
28-
${PYTHON} -m pip install -U pip
29-
${PYTHON} -m pip install -r dev_requirements.txt
30-
$(VENV_NAME)/bin/pre-commit install
31-
touch $(VENV_NAME)/bin/activate
32-
33-
clean:
34-
rm -rf venv
35-
36-
update:
37-
${PYTHON} -m pip install -U -r dev_requirements.txt
38-
$(VENV_NAME)/bin/pre-commit install
15+
pipenv install --dev
3916

40-
test: venv
41-
${PYTHON} -m pytest
17+
test:
18+
pipenv run pytest
4219

43-
lint: venv
44-
$(VENV_NAME)/bin/black -t py310 --exclude $(VENV_NAME) .
20+
lint:
21+
pipenv run black .
4522

46-
pre-commit: venv
47-
$(VENV_NAME)/bin/pre-commit
23+
pre-commit:
24+
pipenv run pre-commit

Pipfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
flask = "==3.0.2"
8+
python-ldap = "==3.4.4"
9+
10+
[dev-packages]
11+
black = "==24.3.0"
12+
pre-commit = "==3.5.0"
13+
pytest = "==8.1.1"

0 commit comments

Comments
 (0)