Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ecdsa
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Apr 19, 2023
2 parents 9d89683 + a3e352a commit f74a9b6
Show file tree
Hide file tree
Showing 17 changed files with 101 additions and 84 deletions.
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

78 changes: 52 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,47 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python }}'
- name: Run tests
run: ./ci.sh
shell: bash
env:
# Should match 'name:' up above
JOB_NAME: 'Windows (${{ matrix.python }})'
- name: "Upload coverage data"
uses: "actions/upload-artifact@v3"
with:
name: coverage-data
path: "empty/.coverage.*"
if-no-files-found: error

Ubuntu:
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
name: 'Ubuntu (${{ matrix.python }})'
timeout-minutes: 10
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
old_cryptography: ['']
extra_name: ['']
include:
- python: pypy-3.7
old_cryptography: ''
extra_name: ', PyPy 3'
python: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.9']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python }}'
- name: Run tests
run: ./ci.sh
env:
OLD_CRYPTOGRAPHY: '${{ matrix.old_cryptography}}'
# Should match 'name:' up above
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
- name: "Upload coverage data"
uses: "actions/upload-artifact@v3"
with:
name: coverage-data
path: "empty/.coverage.*"
if-no-files-found: error

macOS:
name: 'macOS (${{ matrix.python }})'
Expand All @@ -64,16 +63,43 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python }}'
- name: Run tests
run: ./ci.sh
env:
# Should match 'name:' up above
JOB_NAME: 'macOS (${{ matrix.python }})'
- name: "Upload coverage data"
uses: "actions/upload-artifact@v3"
with:
name: coverage-data
path: "empty/.coverage.*"
if-no-files-found: error

coverage:
if: always()
runs-on: "ubuntu-latest"
needs: ["Windows", "Ubuntu", "macOS"]
steps:
- uses: actions/checkout@v3
- name: "Use latest Python so it understands all syntax"
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: "Install coverage"
run: "python -m pip install --upgrade coverage[toml]"

- name: "Download coverage data"
uses: actions/download-artifact@v3
with:
name: coverage-data

- name: "Combine & check coverage"
run: |
python -m coverage combine
python -m coverage report --ignore-errors --show-missing --fail-under=100
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Run lint
Expand Down
10 changes: 6 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# https://docs.readthedocs.io/en/latest/config-file/index.html
version: 2

formats:
- htmlzip
- epub
build:
os: ubuntu-22.04
tools:
python: "3"

python:
version: 3.7
install:
- requirements: docs-requirements.txt
- method: pip
path: .

sphinx:
fail_on_warning: true
6 changes: 1 addition & 5 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ if [ -n "${OLD_CRYPTOGRAPHY:-}" ]; then
fi
mkdir empty
pushd empty
INSTALLDIR=$(python -c "import os, trustme; print(os.path.dirname(trustme.__file__))")
pytest -W error -ra -s ../tests --cov="$INSTALLDIR" --cov=../tests --cov-config="../.coveragerc"

python -m pip install codecov
codecov --tries=9999 --required -F $(uname | tr A-Z a-z)
coverage run --parallel-mode -m pytest -W error -ra -s ../tests
14 changes: 6 additions & 8 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#
alabaster==0.7.13
# via sphinx
babel==2.11.0
babel==2.12.1
# via sphinx
certifi==2022.6.15
# via requests
cffi==1.15.1
# via cryptography
charset-normalizer==3.1.0
# via requests
cryptography==39.0.2
cryptography==40.0.2
# via -r docs-requirements.in
docutils==0.19
# via sphinx
Expand All @@ -28,14 +28,12 @@ jinja2==3.1.2
# via sphinx
markupsafe==2.1.1
# via jinja2
packaging==23.0
packaging==23.1
# via sphinx
pycparser==2.21
# via cffi
pygments==2.14.0
pygments==2.15.1
# via sphinx
pytz==2022.7.1
# via babel
requests==2.28.2
# via sphinx
snowballstemmer==2.2.0
Expand All @@ -46,7 +44,7 @@ sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
Expand All @@ -56,5 +54,5 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-trio==1.1.2
# via -r docs-requirements.in
urllib3==1.26.14
urllib3==1.26.15
# via requests
10 changes: 3 additions & 7 deletions lint-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
#
# pip-compile lint-requirements.in
#
attrs==22.2.0
# via pytest
cffi==1.15.1
# via cryptography
cryptography==39.0.2
cryptography==40.0.2
# via
# -r lint-requirements.in
# types-pyopenssl
exceptiongroup==1.1.0
# via pytest
idna==3.4
# via -r lint-requirements.in
iniconfig==2.0.0
Expand All @@ -22,13 +18,13 @@ mypy==0.910
# via -r lint-requirements.in
mypy-extensions==0.4.4
# via mypy
packaging==23.0
packaging==23.1
# via pytest
pluggy==1.0.0
# via pytest
pycparser==2.21
# via cffi
pytest==7.2.2
pytest==7.3.1
# via -r lint-requirements.in
toml==0.10.2
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ python -m pip install -Ur lint-requirements.txt

# Linting

mypy trustme tests
mypy src/trustme tests
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# PYTHONPATH=~/src/towncrier/src ~/src/towncrier/bin/towncrier
# with the merge-64-66-69 branch checked out.
package = "trustme"
package_dir = "src"
filename = "docs/source/index.rst"
directory = "newsfragments"
# Requires https://github.com/hawkowl/towncrier/pull/64
Expand All @@ -35,3 +36,18 @@ warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true

[tool.coverage.run]
branch = true
omit = ["*/setup.py"]
source = ["trustme"]

[tool.coverage.paths]
source = ["trustme", "*/trustme", "*\\trustme"]

[tool.coverage.setup]
precision = 1
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:"
]
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

# defines __version__
exec(open("trustme/_version.py").read())
exec(open("src/trustme/_version.py").read())

setup(
name="trustme",
Expand All @@ -12,10 +12,11 @@
author="Nathaniel J. Smith",
author_email="njs@pobox.com",
license="MIT OR Apache-2.0",
packages=find_packages(),
packages=find_packages(where="src"),
package_data={
'trustme': ['py.typed'],
},
package_dir={'': 'src'},
url="https://github.com/python-trio/trustme",
python_requires=">=3.7",
install_requires=[
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest>=6.2
pytest-cov
coverage[toml]
PyOpenSSL
service-identity
cryptography
Expand Down
28 changes: 10 additions & 18 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile test-requirements.in
#
attrs==22.2.0
# via
# pytest
# service-identity
attrs==23.1.0
# via service-identity
cffi==1.15.1
# via cryptography
coverage[toml]==5.5
# via pytest-cov
cryptography==39.0.2
coverage[toml]==7.2.3
# via -r test-requirements.in
cryptography==40.0.2
# via
# -r test-requirements.in
# pyopenssl
Expand All @@ -21,7 +19,7 @@ idna==3.4
# via -r test-requirements.in
iniconfig==2.0.0
# via pytest
packaging==23.0
packaging==23.1
# via pytest
pluggy==1.0.0
# via pytest
Expand All @@ -33,17 +31,11 @@ pyasn1-modules==0.2.8
# via service-identity
pycparser==2.21
# via cffi
pyopenssl==23.0.0
pyopenssl==23.1.1
# via -r test-requirements.in
pytest==7.2.0
# via
# -r test-requirements.in
# pytest-cov
pytest-cov==4.0.0
pytest==7.3.1
# via -r test-requirements.in
service-identity==21.1.0
# via -r test-requirements.in
six==1.16.0
# via service-identity
toml==0.10.2
# via coverage

0 comments on commit f74a9b6

Please sign in to comment.