Skip to content

Commit

Permalink
Merge pull request #214 from paw-lu/bump-typer
Browse files Browse the repository at this point in the history
Bump old depenencies
  • Loading branch information
paw-lu authored Nov 27, 2022
2 parents d6b7971 + 52fd2bd commit 5ebfd91
Show file tree
Hide file tree
Showing 14 changed files with 1,248 additions and 1,047 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.10"
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox --force-color --sessions tests-3.8 coverage
- run: pip install nox==2022.11.21
- run: pip install poetry==1.2.2
- run: nox --force-color --sessions tests-3.10 coverage
- if: always()
uses: codecov/codecov-action@v1
32 changes: 19 additions & 13 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,31 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: "3.8"
python-version: "3.10"
- run: >-
pip install
poetry==1.0.5
pre-commit==2.2.0
- name: set PYTHON_VERSION_HASH
poetry==1.2.2
pre-commit==2.20.0
- name: Compute pre-commit cache key
id: pre-commit-cache
shell: python
run: |
echo "::set-env name=PYTHON_VERSION_HASH::$(python -c '
import hashlib
import sys
import hashlib
import sys
payload = sys.version.encode() + sys.executable.encode()
digest = hashlib.sha256(payload).hexdigest()
python = "py{}.{}".format(*sys.version_info[:2])
payload = sys.version.encode() + sys.executable.encode()
digest = hashlib.sha256(payload).hexdigest()
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
print(digest)
')"
- uses: actions/cache@v1
print("::set-output name=result::{}".format(result))
- name: Restore pre-commit cache
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ env.PYTHON_VERSION_HASH }}-${{ hashFiles('.pre-commit-config.yaml') }}
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ steps.pre-commit-cache.outputs.result }}-
- run: poetry install --ansi
- run: pre-commit run --all-files --show-diff-on-failure --color=always
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.10"
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: pip install nox==2022.11.21
- run: pip install poetry==1.2.2
- run: nox --force-color
- run: poetry build --ansi
- uses: pypa/gh-action-pypi-publish@v1.1.0
- uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]
python-version: ["3.8", "3.9", "3.10"]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox --force-color
- run: pip install nox==2022.11.21
- run: pip install poetry==1.2.2
- run: nox --force-color --python=${{ matrix.python-version }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/prettier/prettier
rev: 2.0.2
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.0
hooks:
- id: prettier
- repo: local
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ check_untyped_defs = True
no_implicit_optional = True


[mypy-nox.*,pytest,pytest_mock,rich.*,typer.*]
[mypy-nox.*,pytest,pytest_mock,rich.*,typer.*,toml]
ignore_missing_imports = True
16 changes: 7 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import nox
from nox.sessions import Session


package = "dressup"
python_versions = ["3.8", "3.7", "3.6"]
python_versions = ["3.8", "3.9", "3.10"]
nox.options.sessions = "lint", "safety", "mypy", "pytype", "tests", "xdoctest"
locations = "src", "tests", "noxfile.py", "docs/conf.py", "translator.py"

Expand Down Expand Up @@ -41,7 +40,8 @@ def export(self, *args: str) -> Iterator[str]:
"poetry",
"export",
*args,
"--format=requirements.txt",
"--format=constraints.txt",
"--without-hashes",
f"--output={requirements.name}",
external=True,
)
Expand Down Expand Up @@ -140,7 +140,7 @@ def lint(session: Session) -> None:
def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
poetry = Poetry(session)
with poetry.export("--dev", "--without-hashes") as requirements:
with poetry.export("--dev") as requirements:
install(session, "safety")
session.run("safety", "check", f"--file={requirements}", "--bare")

Expand Down Expand Up @@ -187,14 +187,14 @@ def xdoctest(session: Session) -> None:
session.run("python", "-m", "xdoctest", package, *args)


@nox.session(python="3.8")
@nox.session(python=python_versions[-1])
def coverage(session: Session) -> None:
"""Upload coverage data."""
install(session, "coverage[toml]")
session.run("coverage", "xml", "--fail-under=0")


@nox.session(python="3.8")
@nox.session(python=python_versions[-1])
def docs(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "docs/_build"]
Expand All @@ -207,9 +207,7 @@ def docs(session: Session) -> None:
shutil.rmtree(builddir)

install_package(session)
install(
session, "recommonmark", "sphinx", "sphinx-autobuild", "sphinx-material",
)
install(session, "recommonmark", "sphinx", "sphinx-autobuild", "sphinx-material")

if session.interactive:
session.run("sphinx-autobuild", *args)
Expand Down
Loading

0 comments on commit 5ebfd91

Please sign in to comment.