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

Update ci.yml #5

Merged
merged 6 commits into from
Apr 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
37 changes: 31 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,39 @@ jobs:
run: | # Cache the environments (-r), fail on missing python interpreters (--error-on-missing-interpreters), set dependency resolver backend.
python -m nox -r --error-on-missing-interpreters --python ${{ matrix.python_version }} --default-venv-backend ${{ matrix.venv_backend }}

- name: Build wheels.
if: ${{ matrix.python_version }} == "virtualenv"
run: |
python -m pip wheel --wheel-dir=/tmp/wheelhouse .
- name: Install pypa/build.
run: >-
python -m
pip install
build
--user

- name: Build a binary wheel and a source tarball.
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.

- name: Publish package to Test PyPI.
if: matrix.os == 'ubuntu-latest'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
print_hash: true
skip_existing: true
verbose: true

- name: Publish package to PyPI.
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true
skip_existing: true
verbose: true
18 changes: 0 additions & 18 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
PYTHON: Final[List[str]] = ["3.8", "3.9", "3.10"]

nox.options.sessions = ["black", "isort", "lint", "mypy", "pytest"]
if platform != "win32": # pytype isn't supported on windows.
nox.options.sessions.append("pytype")


def _setup(session: Session) -> None:
Expand Down Expand Up @@ -107,22 +105,6 @@ def mypy(session: Session) -> None:
session.run("mypy", ".")


@nox.session(python=["3.8", "3.9"]) # pytype doesn't support 3.10.
def pytype(session: Session) -> None:
"""Run `pytype` against `av2`.

Args:
session: `nox` session.
"""
env = [
"git+https://github.com/google/pytype@fc08da16d4eab1deace406c52130457a7da66020", # Fixes typing.Final issue.
"pytest", # Required for analysis in the test directory.
]
_setup(session)
session.install(*env)
session.run("pytype", ".")


@nox.session(python=PYTHON)
def pytest(session: Session) -> None:
"""Run `pytest` against `av2`.
Expand Down