Skip to content

Commit

Permalink
97 test failure with prompt toolkit 3032+ (#99)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate (#87)

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.4.0](pre-commit/pre-commit-hooks@v4.1.0...v4.4.0)
- [github.com/PyCQA/flake8: 4.0.1 → 6.0.0](PyCQA/flake8@4.0.1...6.0.0)
- [github.com/psf/black: 22.3.0 → 23.1.0](psf/black@22.3.0...23.1.0)
- [github.com/pre-commit/mirrors-autopep8: v1.6.0 → v2.0.2](pre-commit/mirrors-autopep8@v1.6.0...v2.0.2)
- [github.com/asottile/pyupgrade: v2.31.1 → v3.3.1](asottile/pyupgrade@v2.31.1...v3.3.1)
- [github.com/asottile/reorder_python_imports: v3.0.1 → v3.9.0](asottile/reorder-python-imports@v3.0.1...v3.9.0)
- [github.com/asottile/add-trailing-comma: v2.2.2 → v2.4.0](asottile/add-trailing-comma@v2.2.2...v2.4.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Scheduled monthly dependency update for October (#92)

* Update coverage from 6.3.2 to 6.5.0

* Update pytest from 7.0.1 to 7.1.3

* Update pytest-mock from 3.7.0 to 3.9.0

* Update requests-mock from 1.9.3 to 1.10.0

* Update sphinx from 4.4.0 to 5.2.3

* Update sphinx-markdown-tables from 0.0.15 to 0.0.17

* Update docstr-coverage from 2.1.1 to 2.2.0

* Update flake8 from 4.0.1 to 5.0.4

* Update pre-commit from 2.17.0 to 2.20.0

* Update click from 8.0.4 to 8.1.3

* Update colorama from 0.4.4 to 0.4.5

* Update cryptography from 36.0.1 to 38.0.1

* Update pyopenssl from 22.0.0 to 22.1.0

* Update requests from 2.27.1 to 2.28.1

* Scheduled monthly dependency update for November (#93)

* Update coverage from 6.3.2 to 6.5.0

* Update pytest from 7.0.1 to 7.2.0

* Update pytest-mock from 3.7.0 to 3.10.0

* Update requests-mock from 1.9.3 to 1.10.0

* Update sphinx from 4.4.0 to 5.3.0

* Update sphinx-markdown-tables from 0.0.15 to 0.0.17

* Update docstr-coverage from 2.1.1 to 2.2.0

* Update flake8 from 4.0.1 to 5.0.4

* Update pre-commit from 2.17.0 to 2.20.0

* Update click from 8.0.4 to 8.1.3

* Update colorama from 0.4.4 to 0.4.6

* Update cryptography from 36.0.1 to 38.0.2

* Update pyopenssl from 22.0.0 to 22.1.0

* Update requests from 2.27.1 to 2.28.1

---------

Co-authored-by: matthieu Bouamama <57527739+tyki6@users.noreply.github.com>

* Scheduled monthly dependency update for December (#94)

* Update coverage from 6.3.2 to 6.5.0

* Update pytest from 7.0.1 to 7.2.0

* Update pytest-mock from 3.7.0 to 3.10.0

* Update requests-mock from 1.9.3 to 1.10.0

* Update sphinx from 4.4.0 to 5.3.0

* Update sphinx-markdown-tables from 0.0.15 to 0.0.17

* Update sphinx-rtd-theme from 1.0.0 to 1.1.1

* Update docstr-coverage from 2.1.1 to 2.2.0

* Update flake8 from 4.0.1 to 6.0.0

* Update pre-commit from 2.17.0 to 2.20.0

* Update click from 8.0.4 to 8.1.3

* Update colorama from 0.4.4 to 0.4.6

* Update cryptography from 36.0.1 to 38.0.4

* Update pyopenssl from 22.0.0 to 22.1.0

* Update requests from 2.27.1 to 2.28.1

---------

Co-authored-by: matthieu Bouamama <57527739+tyki6@users.noreply.github.com>

* Bump cryptography from 36.0.1 to 39.0.1 (#96)

* Scheduled monthly dependency update for January (#95)

* Update coverage from 6.3.2 to 7.0.1

* Update pytest from 7.0.1 to 7.2.0

* Update pytest-mock from 3.7.0 to 3.10.0

* Update requests-mock from 1.9.3 to 1.10.0

* Update sphinx from 4.4.0 to 6.0.0

* Update sphinx-markdown-tables from 0.0.15 to 0.0.17

* Update sphinx-rtd-theme from 1.0.0 to 1.1.1

* Update docstr-coverage from 2.1.1 to 2.2.0

* Update flake8 from 4.0.1 to 6.0.0

* Update pre-commit from 2.17.0 to 2.21.0

* Update click from 8.0.4 to 8.1.3

* Update colorama from 0.4.4 to 0.4.6

* Update cryptography from 36.0.1 to 38.0.4

* Update pyopenssl from 22.0.0 to 22.1.0

* Update requests from 2.27.1 to 2.28.1

* Bump cryptography from 36.0.1 to 39.0.1

Bumps [cryptography](/~https://github.com/pyca/cryptography) from 36.0.1 to 39.0.1.
- [Release notes](/~https://github.com/pyca/cryptography/releases)
- [Changelog](/~https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@36.0.1...39.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: pyup.io bot <github-bot@pyup.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: matthieu Bouamama <57527739+tyki6@users.noreply.github.com>

* Scheduled monthly dependency update for March (#98)

* Update coverage from 6.3.2 to 7.2.1

* Update pytest from 7.0.1 to 7.2.1

* Update pytest-mock from 3.7.0 to 3.10.0

* Update requests-mock from 1.9.3 to 1.10.0

* Update sphinx from 4.4.0 to 6.1.3

* Update sphinx-markdown-tables from 0.0.15 to 0.0.17

* Update sphinx-rtd-theme from 1.0.0 to 1.2.0

* Update docstr-coverage from 2.1.1 to 2.2.0

* Update flake8 from 4.0.1 to 6.0.0

* Update pre-commit from 2.17.0 to 3.1.1

* Update click from 8.0.4 to 8.1.3

* Update colorama from 0.4.4 to 0.4.6

* Update cryptography from 36.0.1 to 39.0.1

* Update pyopenssl from 22.0.0 to 23.0.0

* Update requests from 2.27.1 to 2.28.2

---------

Co-authored-by: matthieu Bouamama <57527739+tyki6@users.noreply.github.com>

* feat: enable poetry

* feat: 3.11 compliance

* style: lint

* style: remove test file

* ci: poetry compliance

* fix: docker + poetry

* fix: poetry python version for unit test

* fix: poetry python version for unit test

* fix: unit test tox

* fix: unit test tox poetry installer

* fix: unit test tox poetry installer

* fix: unit test tox poetry installer

* fix: allow poetry as external command for tox test

* fix: ci_test

* docs: update changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pyup.io bot <github-bot@pyup.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 10, 2023
1 parent e101c55 commit 73c4d58
Show file tree
Hide file tree
Showing 20 changed files with 1,950 additions and 100 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install dependencies"
run: |
pip install pre-commit
Expand All @@ -28,21 +28,14 @@ jobs:
uses: brpaz/hadolint-action@v1.2.1
with:
dockerfile: Dockerfile
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
docstr:
runs-on: "ubuntu-latest"
name: "Run docstr"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install dependencies"
run: |
pip install docstr-coverage
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@ jobs:
runs-on: "ubuntu-latest"
name: "Unit test for Python ${{ matrix.python-version }}"
env:
USING_COVERAGE: '3.10'
USING_COVERAGE: '3.11'

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
pip install poetry
poetry install
- name: "Run tox targets for ${{ matrix.python-version }}"
run: "make tox"

- name: "Get coverage"
run: |
set -xe
pip install -r dev-requirements.txt
pip install coverage
coverage combine
coverage xml
if: "contains(env.USING_COVERAGE, matrix.python-version)"
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/

*.json
*.crt
*.pem
# Translations
*.mo
*.pot
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: /~https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: check-docstring-first
Expand All @@ -11,30 +11,30 @@ repos:
args: ['--django']
- id: requirements-txt-fixer
- repo: /~https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.10.0]
additional_dependencies: [flake8-typing-imports==1.14.0]
- repo: /~https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black
- repo: /~https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
rev: v2.0.2
hooks:
- id: autopep8
- repo: /~https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: /~https://github.com/asottile/reorder_python_imports
rev: v3.0.1
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--py3-plus]
- repo: /~https://github.com/asottile/add-trailing-comma
rev: v2.2.2
rev: v2.4.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.6.1] - 10-03-2022
### Added
- python 3.11 compliance

## [1.6.0] - 06-04-2022
### Added
- python 3.10 compliance
Expand Down
42 changes: 24 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
FROM bitnami/python:3.10 as builder
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install --no-install-recommends -y git
WORKDIR /home/app
FROM bitnami/python:3.11 as base
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /app

FROM base as poetry
RUN pip install poetry==1.4.0 --no-cache-dir
COPY poetry.lock pyproject.toml /app/
RUN poetry export -o requirements.txt

COPY requirements.txt .
COPY dev-requirements.txt .
RUN pip install --no-cache-dir --requirement requirements.txt
FROM base as build
COPY --from=poetry /app/requirements.txt /tmp/requirements.txt
RUN python -m venv .venv && \
.venv/bin/pip install -r /tmp/requirements.txt

FROM base as builder
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install make --no-install-recommends -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV PATH=/app/.venv/bin:$PATH
ENV PYTHONPATH=${PYTHONPATH}:/app/myjwt
COPY --from=build /app/.venv /app/.venv
COPY .git .git
# for docs/requirements
COPY docs/ docs/
COPY myjwt myjwt
COPY wordlist wordlist
COPY setup.py setup.py
COPY README.md README.md
ENV PYTHONPATH=${PYTHONPATH}:/home/app/myjwt
RUN python setup.py install

FROM bitnami/python:3.10

COPY --from=builder /opt/bitnami/python/lib/python3.10/site-packages /opt/bitnami/python/lib/python3.10/site-packages
COPY --from=builder /opt/bitnami/python/bin/myjwt /opt/bitnami/python/bin/myjwt
WORKDIR /home

COPY wordlist wordlist
ENTRYPOINT ["myjwt"]
ENTRYPOINT ["python", "myjwt/myjwt_cli.py"]
15 changes: 1 addition & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
install:
pip install -r requirements.txt

install-dev:
pip install -r dev-requirements.txt

install-lint:
pip install -r lint-requirements.txt

poetry install
install-docs:
cd docs && pip install -r requirements.txt && cd ..

full-install: install install-dev install-lint install-docs

lint:
pre-commit run --all-files
tox:
Expand Down Expand Up @@ -53,10 +43,7 @@ freeze:
pip freeze > freeze.txt
help:
@echo "make install Install requirements."
@echo "make install-dev Install dev requirements."
@echo "make install-lint Install lint requirements."
@echo "make install-docs Install docs requirements."
@echo "make full-install Install requirements + dev requirements + lint requirements + docs requirements."
@echo "make lint Run Lint."
@echo "make docstr Run docstr report."
@echo "make tox Run Unit test tox."
Expand Down
4 changes: 0 additions & 4 deletions dev-requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recommonmark==0.7.1
Sphinx==6.0.0
Sphinx==6.1.3
sphinx-markdown-tables==0.0.17
sphinx-rtd-theme==1.1.1
sphinx-rtd-theme==1.2.0
4 changes: 4 additions & 0 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.6.1] - 10-03-2022
### Added
- python 3.11 compliance

## [1.6.0] - 06-04-2022
### Added
- python 3.10 compliance
Expand Down
3 changes: 0 additions & 3 deletions lint-requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion myjwt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""autogenerated"""
__version__ = "1.6.0"
__version__ = "1.6.1"
__commit__ = "34a82dc12b295caaec3b5803ff553713c44765e0"
4 changes: 2 additions & 2 deletions myjwt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ def create_crt():
cert.sign(k, "sha256")
crt = "selfsigned.crt"
pem = "private.pem"
with open("selfsigned.crt", "wt") as f:
with open("selfsigned.crt", "w") as f:
f.write(
crypto.dump_certificate(crypto.FILETYPE_PEM, cert).decode("utf-8"),
)
f.close()
with open("private.pem", "wt") as f:
with open("private.pem", "w") as f:
f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, k).decode("utf-8"))
f.close()
return crt, pem
Expand Down
Loading

0 comments on commit 73c4d58

Please sign in to comment.