Skip to content

Commit 0569939

Browse files
authored
Merge pull request #59 from IdentityPython/pyproject
Use pyproject.toml
2 parents 0abfce9 + a9ee149 commit 0569939

File tree

8 files changed

+81
-71
lines changed

8 files changed

+81
-71
lines changed

.coveragerc

-8
This file was deleted.

.travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ addons:
1313
install:
1414
- pip install codecov
1515
- pip install tox tox-travis
16-
- pip install isort black
1716
script:
1817
- codecov --version
1918
- tox
20-
- isort --check src tests
21-
- black -l 100 --check src tests
2219
after_success:
2320
- codecov
2421
notifications:

doc/conf.py

+34-35
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,38 @@
3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
34-
extensions = ['sphinx.ext.autodoc',
35-
'sphinx.ext.intersphinx',
36-
'sphinx.ext.coverage',
37-
'sphinx.ext.viewcode']
34+
extensions = [
35+
"sphinx.ext.autodoc",
36+
"sphinx.ext.intersphinx",
37+
"sphinx.ext.coverage",
38+
"sphinx.ext.viewcode",
39+
]
3840

3941
# Add any paths that contain templates here, relative to this directory.
40-
templates_path = ['_templates']
42+
templates_path = ["_templates"]
4143

4244
# The suffix(es) of source filenames.
4345
# You can specify multiple suffix as a list of string:
4446
#
4547
# source_suffix = ['.rst', '.md']
46-
source_suffix = '.rst'
48+
source_suffix = ".rst"
4749

4850
# The master toctree document.
49-
master_doc = 'index'
51+
master_doc = "index"
5052

5153
# General information about the project.
52-
project = 'CryptoJWT'
53-
copyright = '2018, Roland Hedberg'
54-
author = 'Roland Hedberg'
54+
project = "CryptoJWT"
55+
copyright = "2018, Roland Hedberg"
56+
author = "Roland Hedberg"
5557

5658
# The version info for the project you're documenting, acts as replacement for
5759
# |version| and |release|, also used in various other places throughout the
5860
# built documents.
5961
#
6062
# The short X.Y version.
61-
version = '0.4'
63+
version = "0.4"
6264
# The full version, including alpha/beta/rc tags.
63-
release = '0.4'
65+
release = "0.4"
6466

6567
# The language for content autogenerated by Sphinx. Refer to documentation
6668
# for a list of supported languages.
@@ -72,10 +74,10 @@
7274
# List of patterns, relative to source directory, that match files and
7375
# directories to ignore when looking for source files.
7476
# This patterns also effect to html_static_path and html_extra_path
75-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
77+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7678

7779
# The name of the Pygments (syntax highlighting) style to use.
78-
pygments_style = 'sphinx'
80+
pygments_style = "sphinx"
7981

8082
# If true, `todo` and `todoList` produce output, else they produce nothing.
8183
todo_include_todos = False
@@ -86,7 +88,7 @@
8688
# The theme to use for HTML and HTML Help pages. See the documentation for
8789
# a list of builtin themes.
8890
#
89-
html_theme = 'default'
91+
html_theme = "default"
9092

9193
# Theme options are theme-specific and customize the look and feel of a theme
9294
# further. For a list of options available for each theme, see the
@@ -97,25 +99,25 @@
9799
# Add any paths that contain custom static files (such as style sheets) here,
98100
# relative to this directory. They are copied after the builtin static files,
99101
# so a file named "default.css" will overwrite the builtin "default.css".
100-
html_static_path = ['_static']
102+
html_static_path = ["_static"]
101103

102104
# Custom sidebar templates, must be a dictionary that maps document names
103105
# to template names.
104106
#
105107
# This is required for the alabaster theme
106108
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
107109
html_sidebars = {
108-
'**': [
109-
'relations.html', # needs 'show_related': True theme option to display
110-
'searchbox.html',
110+
"**": [
111+
"relations.html", # needs 'show_related': True theme option to display
112+
"searchbox.html",
111113
]
112114
}
113115

114116

115117
# -- Options for HTMLHelp output ------------------------------------------
116118

117119
# Output file base name for HTML help builder.
118-
htmlhelp_basename = 'CryptoJWTdoc'
120+
htmlhelp_basename = "CryptoJWTdoc"
119121

120122

121123
# -- Options for LaTeX output ---------------------------------------------
@@ -124,15 +126,12 @@
124126
# The paper size ('letterpaper' or 'a4paper').
125127
#
126128
# 'papersize': 'letterpaper',
127-
128129
# The font size ('10pt', '11pt' or '12pt').
129130
#
130131
# 'pointsize': '10pt',
131-
132132
# Additional stuff for the LaTeX preamble.
133133
#
134134
# 'preamble': '',
135-
136135
# Latex figure (float) alignment
137136
#
138137
# 'figure_align': 'htbp',
@@ -142,19 +141,15 @@
142141
# (source start file, target name, title,
143142
# author, documentclass [howto, manual, or own class]).
144143
latex_documents = [
145-
(master_doc, 'CryptoJWT.tex', 'CryptoJWT Documentation',
146-
'Roland Hedberg', 'manual'),
144+
(master_doc, "CryptoJWT.tex", "CryptoJWT Documentation", "Roland Hedberg", "manual"),
147145
]
148146

149147

150148
# -- Options for manual page output ---------------------------------------
151149

152150
# One entry per manual page. List of tuples
153151
# (source start file, name, description, authors, manual section).
154-
man_pages = [
155-
(master_doc, 'cryptojwt', 'CryptoJWT Documentation',
156-
[author], 1)
157-
]
152+
man_pages = [(master_doc, "cryptojwt", "CryptoJWT Documentation", [author], 1)]
158153

159154

160155
# -- Options for Texinfo output -------------------------------------------
@@ -163,13 +158,17 @@
163158
# (source start file, target name, title, author,
164159
# dir menu entry, description, category)
165160
texinfo_documents = [
166-
(master_doc, 'CryptoJWT', 'CryptoJWT Documentation',
167-
author, 'CryptoJWT', 'One line description of project.',
168-
'Miscellaneous'),
161+
(
162+
master_doc,
163+
"CryptoJWT",
164+
"CryptoJWT Documentation",
165+
author,
166+
"CryptoJWT",
167+
"One line description of project.",
168+
"Miscellaneous",
169+
),
169170
]
170171

171172

172-
173-
174173
# Example configuration for intersphinx: refer to the Python standard library.
175-
intersphinx_mapping = {'https://docs.python.org/': None}
174+
intersphinx_mapping = {"https://docs.python.org/": None}

pyproject.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# PEP 518: https://www.python.org/dev/peps/pep-0518/
2+
3+
[tool.black]
4+
line-length = 100
5+
6+
[tool.isort]
7+
force_single_line = true
8+
known_first_party = "cryptojwt"
9+
include_trailing_comma = true
10+
force_grid_wrap = 0
11+
use_parentheses = true
12+
line_length = 100
13+
14+
[tool.coverage.run]
15+
branch = true
16+
17+
[tool.coverage.report]
18+
exclude_lines = [
19+
"pragma: no cover",
20+
"raise NotImplementedError",
21+
]

setup.cfg

-7
This file was deleted.

setup.py

+19-14
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@
2020

2121
from setuptools import setup
2222

23-
__author__ = 'Roland Hedberg'
23+
__author__ = "Roland Hedberg"
2424

25-
with open('src/cryptojwt/__init__.py', 'r') as fd:
26-
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
27-
fd.read(), re.MULTILINE).group(1)
25+
with open("src/cryptojwt/__init__.py", "r") as fd:
26+
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
2827

29-
tests_requires = ['responses', 'pytest', 'isort>=5.0.2', 'black']
28+
tests_requires = ["responses", "pytest", "isort>=5.0.2", "black"]
3029

3130
setup(
3231
name="cryptojwt",
@@ -35,8 +34,14 @@
3534
author="Roland Hedberg",
3635
author_email="[email protected]",
3736
license="Apache 2.0",
38-
packages=["cryptojwt", "cryptojwt/jwe", "cryptojwt/jwk", "cryptojwt/jws", "cryptojwt/tools",
39-
"cryptojwt/serialize"],
37+
packages=[
38+
"cryptojwt",
39+
"cryptojwt/jwe",
40+
"cryptojwt/jwk",
41+
"cryptojwt/jws",
42+
"cryptojwt/tools",
43+
"cryptojwt/serialize",
44+
],
4045
package_dir={"": "src"},
4146
classifiers=[
4247
"Development Status :: 4 - Beta",
@@ -45,22 +50,22 @@
4550
"Programming Language :: Python :: 3.5",
4651
"Programming Language :: Python :: 3.6",
4752
"Programming Language :: Python :: 3.7",
48-
"Programming Language :: Python :: 3.8"
53+
"Programming Language :: Python :: 3.8",
4954
],
5055
install_requires=["cryptography", "requests"],
51-
tests_require=['pytest'],
56+
tests_require=["pytest"],
5257
zip_safe=False,
5358
extras_require={
54-
'testing': tests_requires,
55-
'docs': ['Sphinx', 'sphinx-autobuild', 'alabaster'],
56-
'quality': ['isort>=5.0.2', 'black'],
59+
"testing": tests_requires,
60+
"docs": ["Sphinx", "sphinx-autobuild", "alabaster"],
61+
"quality": ["isort>=5.0.2", "black"],
5762
},
58-
scripts=glob.glob('script/*.py'),
63+
scripts=glob.glob("script/*.py"),
5964
entry_points={
6065
"console_scripts": [
6166
"jwkgen = cryptojwt.tools.keygen:main",
6267
"jwkconv = cryptojwt.tools.keyconv:main",
6368
"jwtpeek = cryptojwt.tools.jwtpeek:main",
6469
]
65-
}
70+
},
6671
)

tests/test_04_key_jar.py

+1
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ def test_no_use(self):
444444
assert enc_key != []
445445

446446
@pytest.mark.network
447+
@pytest.mark.skip("connect-op.herokuapp.com is broken")
447448
def test_provider(self):
448449
kj = KeyJar()
449450
_url = "https://connect-op.herokuapp.com/jwks.json"

tox.ini

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ envlist = py{36,37,38},quality
44
[testenv]
55
passenv = CI TRAVIS TRAVIS_*
66
commands =
7-
py.test --cov=cryptojwt tests/ {posargs}
7+
py.test --cov=cryptojwt --isort --black {posargs}
88
codecov
99
extras = testing
1010
deps =
1111
codecov
12+
pytest-black
1213
pytest-cov
1314
pytest-httpserver
15+
pytest-isort
1416

1517
[pep8]
1618
max-line-length=100
@@ -20,10 +22,10 @@ addopts = --color=yes
2022
markers = network
2123

2224
[testenv:quality]
23-
# Black need python 3.6
24-
basepython = python3.6
25+
basepython = python3.8
2526
ignore_errors = True
2627
deps = twine
2728
extras = quality
2829
commands =
29-
isort --recursive --diff --check-only src/ tests/
30+
isort --check --diff src tests
31+
black --check src tests

0 commit comments

Comments
 (0)