Skip to content

Commit 3ea5d97

Browse files
authored
Merge pull request #11 from LeanderCS/10
10 | Add testing for all supportet python versions
2 parents 57573fd + e992720 commit 3ea5d97

15 files changed

+146
-13
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,15 @@ jobs:
1717
- name: Build Docker image
1818
run: docker build . -t flask-inputfilter
1919

20-
- name: Run tests in Docker
20+
- name: Run tests in Docker and upload coverage to Coveralls
21+
env:
22+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
2123
run: |
2224
set -x # Print commands and their arguments as they are executed.
2325
set -e # Exit immediately if a command exits with a non-zero status.
2426
set -u # Exit immediately if a variable is not defined.
2527
26-
docker run flask-inputfilter coverage run --source=flask_inputfilter -m pytest test/
27-
28-
- name: Upload coverage to Coveralls
29-
env:
30-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
31-
run: docker run -e COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} flask-inputfilter coveralls
28+
docker run -e COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} flask-inputfilter sh -c "coverage run --source=flask_inputfilter -m pytest test/ && coveralls"
3229
3330
- name: Run code style checks
3431
run: |

.github/workflows/test_env.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run Tests on all environments
2+
3+
on: [push]
4+
5+
permissions:
6+
actions: read
7+
contents: read
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Build Docker image
18+
run: docker build -f env_configs/Dockerfile . -t flask-inputfilter-env
19+
20+
- name: Run tests in Docker
21+
run: |
22+
set -x # Print commands and their arguments as they are executed.
23+
set -e # Exit immediately if a command exits with a non-zero status.
24+
set -u # Exit immediately if a variable is not defined.
25+
26+
docker run flask-inputfilter-env tox

CHAGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,28 @@
33
All notable changes to this project will be documented in this file.
44

55

6+
## [0.0.7] - 2025-01-14
7+
8+
### Added
9+
10+
- Workflow to run tests on all supported python versions. [Check it out](.github/workflows/test_env.yaml)
11+
- Added more test coverage for validators and filters.
12+
- Added tracking of coverage in tests.
13+
14+
### Changed
15+
16+
- Updated root README.md to include badges.
17+
18+
619
## [0.0.6] - 2025-01-12
720

821
### Added
922

10-
- New date validators and filters
23+
- New date validators and filters.
1124

1225
### Changed
1326

14-
- Dropped support for Python 3.6
27+
- Dropped support for Python 3.6.
1528

1629

1730
## [0.0.5] - 2025-01-12

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ Quickstart
4040
To use the `InputFilter` class, create a new class that inherits from it and define the
4141
fields you want to validate and filter.
4242

43-
There are numerous filters and validators available, but you can also create your own.
44-
Refer to the [CREATE_OWN.md](CREATE_OWN.md) file for guidance.
43+
There are numerous filters and validators available, but you can also create your `own <CREATE_OWN.md>`.
4544

4645
Definition
4746
----------

env_configs/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM python:3.7-slim
2+
3+
WORKDIR /app
4+
5+
RUN apt-get update && apt-get install -y \
6+
gcc \
7+
make \
8+
build-essential \
9+
libssl-dev \
10+
zlib1g-dev \
11+
libbz2-dev \
12+
libreadline-dev \
13+
libsqlite3-dev \
14+
wget \
15+
curl \
16+
llvm \
17+
libncurses5-dev \
18+
libncursesw5-dev \
19+
xz-utils \
20+
tk-dev \
21+
libffi-dev \
22+
liblzma-dev \
23+
git \
24+
libjpeg-dev
25+
26+
RUN curl https://pyenv.run | bash
27+
28+
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:/root/.pyenv/versions/3.7.12/bin:$PATH"
29+
RUN echo 'export PATH="/root/.pyenv/bin:$PATH"' >> ~/.bashrc
30+
RUN echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
31+
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
32+
RUN echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
33+
34+
RUN /root/.pyenv/bin/pyenv install 3.7.12
35+
RUN /root/.pyenv/bin/pyenv install 3.8.12
36+
RUN /root/.pyenv/bin/pyenv install 3.9.7
37+
RUN /root/.pyenv/bin/pyenv install 3.10.2
38+
RUN /root/.pyenv/bin/pyenv install 3.11.0
39+
RUN /root/.pyenv/bin/pyenv install 3.12.0
40+
RUN /root/.pyenv/bin/pyenv install 3.13.0
41+
42+
RUN /root/.pyenv/bin/pyenv global 3.7.12 3.8.12 3.9.7 3.10.2 3.11.0 3.12.0 3.13.0
43+
44+
RUN pip install --upgrade pip
45+
46+
COPY ../requirements.txt /app
47+
48+
RUN pip install --no-cache-dir -r requirements.txt && pip install tox
49+
50+
COPY .. /app

env_configs/requirements-py310.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flask==2.1
2+
pillow==8.0.0
3+
pytest
4+
requests==2.22.0
5+
Werkzeug==2.0.3
6+
typing_extensions

env_configs/requirements-py311.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flask==2.1
2+
pillow==8.0.0
3+
pytest
4+
requests==2.22.0
5+
Werkzeug==2.0.3
6+
typing_extensions

env_configs/requirements-py312.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flask
2+
pillow
3+
pytest
4+
requests
5+
typing_extensions

env_configs/requirements-py313.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flask
2+
pillow
3+
pytest
4+
requests
5+
typing_extensions

env_configs/requirements-py37.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flask==2.1
2+
pillow==8.0.0
3+
pytest
4+
requests==2.22.0

0 commit comments

Comments
 (0)