Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(nox): configure nox #34

Merged
merged 9 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ omit =
setup.py
versioneer.py
mojang/_version.py
noxfile.py

[report]
omit =
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,10 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
python -m pip install nox
nox -rs tests-${{ matrix.python-version }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ sphinx:
# Install dev requirements and package
python:
install:
- requirements: requirements-dev.txt
- requirements: requirements/requirements-docs.txt
- method: setuptools
path: .
8 changes: 1 addition & 7 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"
flake8 = "*"
pre-commit = "*"
pytest-cov = "*"
importlib-metadata = "*"
sphinx = "*"
furo = "*"
sphinxext-opengraph = "*"
sphinx-copybutton = "*"
nox = "*"

[packages]
requests = "*"
Expand Down
563 changes: 84 additions & 479 deletions Pipfile.lock

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions examples/microsoft_flask/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
certifi==2021.5.30
cffi==1.14.6
charset-normalizer==2.0.5
click==8.0.1
colorama==0.4.4
cryptography==3.4.8
decorator==5.1.0
Flask==2.0.1
idna==3.2
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
msal==1.14.0
pycparser==2.20
PyJWT==2.1.0
pymojang==1.3.0
python-dotenv==0.19.0
requests==2.26.0
six==1.16.0
urllib3==1.26.6
validators==0.18.2
Werkzeug==2.0.1
30 changes: 30 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import nox


@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
def tests(session: nox.Session):
session.install("-r", "requirements/requirements-tests.txt")
session.install(".")
session.run("pytest")


@nox.session
def docs(session: nox.Session):
session.install("-r", "requirements/requirements-docs.txt")
session.install(".")
with session.chdir("docs/"):
session.run("make", "html")


@nox.session
def lint(session: nox.Session):
session.install("pre-commit")
session.run("pre-commit", "run", *session.posargs)


@nox.session
def example(session: nox.Session):
session.install(".")
with session.chdir("examples/microsoft_flask"):
session.install("-r", "requirements.txt")
session.run("python", "app.py")
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@ exclude = '''
| docs
)/
'''

[tool.commitizen]
name = "cz_conventional_commits"
version = "1.4.0"
tag_format = "v$version"
128 changes: 0 additions & 128 deletions requirements-dev.txt

This file was deleted.

30 changes: 0 additions & 30 deletions requirements.txt

This file was deleted.

8 changes: 8 additions & 0 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-r ./requirements-docs.txt
-r ./requirements-tests.txt

versioneer==0.22
flake8==4.0.1
pre-commit==2.18.1
importlib-metadata==4.11.3
nox==2022.1.7
5 changes: 5 additions & 0 deletions requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

sphinx==4.5.0
sphinxext-opengraph==0.6.3
sphinx-copybutton==0.5.0
furo==2022.4.7
3 changes: 3 additions & 0 deletions requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

pytest
pytest-cov
4 changes: 4 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
requests==2.27.1
validators==0.18.2
pyjwt[crypto]==2.3.0
msal==1.17.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tag_prefix = v
ignore = E203, E266, E501, W503, F403, F401, E731
max-line-length = 79
select = B,C,E,F,W,T4,B9
exclude = docs/*,versioneer.py,_version.py
exclude = docs/*,versioneer.py,_version.py,noxfile.py

[tool:pytest]
addopts = --doctest-modules --cov=./ --cov-report=xml ./tests