Rename master to main, use 3.10 final, add workflow_dispatch

This commit is contained in:
Hugo van Kemenade 2021-10-19 13:08:53 +03:00
parent 3db88e98ce
commit 9072b98a18
8 changed files with 42 additions and 36 deletions

View file

@ -3,14 +3,15 @@ name: Deploy
on: on:
push: push:
branches: branches:
- master - main
release: release:
types: types:
- published - published
workflow_dispatch:
jobs: jobs:
build: deploy:
if: github.repository == 'pylast/pylast' if: github.repository_owner == 'pylast'
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
@ -29,18 +30,18 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: "3.10"
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install -U pip python -m pip install -U pip
python -m pip install -U setuptools twine wheel python -m pip install -U build twine wheel
- name: Build package - name: Build package
run: | run: |
python setup.py --version python setup.py --version
python setup.py sdist --format=gztar bdist_wheel python -m build
twine check dist/* twine check --strict dist/*
- name: Publish package to PyPI - name: Publish package to PyPI
if: github.event.action == 'published' if: github.event.action == 'published'

View file

@ -1,12 +1,15 @@
name: Sync labels name: Sync labels
on: on:
push: push:
branches: branches:
- master - main
paths: paths:
- .github/labels.yml - .github/labels.yml
workflow_dispatch:
jobs: jobs:
build: sync:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View file

@ -1,6 +1,6 @@
name: Lint name: Lint
on: [push, pull_request] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
lint: lint:

View file

@ -4,14 +4,15 @@ on:
push: push:
# branches to consider in the event; optional, defaults to all # branches to consider in the event; optional, defaults to all
branches: branches:
- master - main
workflow_dispatch:
jobs: jobs:
update_release_draft: update_release_draft:
if: github.repository == 'pylast/pylast' if: github.repository_owner == 'hugovk'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Drafts your next release notes as pull requests are merged into "master" # Drafts your next release notes as pull requests are merged into "main"
- uses: release-drafter/release-drafter@v5 - uses: release-drafter/release-drafter@v5
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,17 +1,17 @@
name: Test name: Test
on: [push, pull_request] on: [push, pull_request, workflow_dispatch]
env: env:
FORCE_COLOR: 1 FORCE_COLOR: 1
jobs: jobs:
build: test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev", "pypy3"] python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]
os: [ubuntu-20.04] os: [ubuntu-20.04]
include: include:
# Include new variables for Codecov # Include new variables for Codecov
@ -35,10 +35,10 @@ jobs:
with: with:
path: ${{ steps.pip-cache.outputs.dir }} path: ${{ steps.pip-cache.outputs.dir }}
key: key:
${{ matrix.os }}-${{ matrix.python-version }}-v3-${{ ${{ matrix.os }}-${{ matrix.python-version }}-v1-${{
hashFiles('**/setup.py') }} hashFiles('**/setup.py') }}
restore-keys: | restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v3- ${{ matrix.os }}-${{ matrix.python-version }}-v1-
- name: Install dependencies - name: Install dependencies
run: | run: |
@ -56,7 +56,7 @@ jobs:
PYLAST_USERNAME: ${{ secrets.PYLAST_USERNAME }} PYLAST_USERNAME: ${{ secrets.PYLAST_USERNAME }}
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v2
with: with:
flags: ${{ matrix.codecov-flag }} flags: ${{ matrix.codecov-flag }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }} name: ${{ matrix.os }} Python ${{ matrix.python-version }}

View file

@ -5,8 +5,8 @@ pyLast
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pylast.svg)](https://pypi.org/project/pylast/) [![Supported Python versions](https://img.shields.io/pypi/pyversions/pylast.svg)](https://pypi.org/project/pylast/)
[![PyPI downloads](https://img.shields.io/pypi/dm/pylast.svg)](https://pypistats.org/packages/pylast) [![PyPI downloads](https://img.shields.io/pypi/dm/pylast.svg)](https://pypistats.org/packages/pylast)
[![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions) [![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions)
[![Coverage (Codecov)](https://codecov.io/gh/pylast/pylast/branch/master/graph/badge.svg)](https://codecov.io/gh/pylast/pylast) [![Coverage (Codecov)](https://codecov.io/gh/pylast/pylast/branch/main/graph/badge.svg)](https://codecov.io/gh/pylast/pylast)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Code style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![DOI](https://zenodo.org/badge/7803088.svg)](https://zenodo.org/badge/latestdoi/7803088) [![DOI](https://zenodo.org/badge/7803088.svg)](https://zenodo.org/badge/latestdoi/7803088)
A Python interface to [Last.fm](https://www.last.fm/) and other API-compatible websites A Python interface to [Last.fm](https://www.last.fm/) and other API-compatible websites
@ -98,12 +98,12 @@ track.add_tags(("awesome", "favorite"))
More examples in More examples in
<a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and <a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and
[tests/](https://github.com/pylast/pylast/tree/master/tests). [tests/](https://github.com/pylast/pylast/tree/main/tests).
Testing Testing
------- -------
The [tests/](https://github.com/pylast/pylast/tree/master/tests) directory contains The [tests/](https://github.com/pylast/pylast/tree/main/tests) directory contains
integration and unit tests with Last.fm, and plenty of code examples. integration and unit tests with Last.fm, and plenty of code examples.
For integration tests you need a test account at Last.fm that will become cluttered with For integration tests you need a test account at Last.fm that will become cluttered with

View file

@ -1,21 +1,21 @@
# Release Checklist # Release Checklist
* [ ] Get master to the appropriate code release state. - [ ] Get `main` to the appropriate code release state.
[GitHub Actions](https://github.com/pylast/pylast/actions) should be running cleanly for [GitHub Actions](https://github.com/pylast/pylast/actions) should be running cleanly for
all merges to master. all merges to `main`.
[![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions) [![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions)
* [ ] Edit release draft, adjust text if needed: - [ ] Edit release draft, adjust text if needed:
https://github.com/pylast/pylast/releases https://github.com/pylast/pylast/releases
* [ ] Check next tag is correct, amend if needed - [ ] Check next tag is correct, amend if needed
* [ ] Publish release - [ ] Publish release
* [ ] Check the tagged [GitHub Actions build](https://github.com/pylast/pylast/actions?query=workflow%3ADeploy) - [ ] Check the tagged [GitHub Actions build](https://github.com/pylast/pylast/actions?query=workflow%3ADeploy)
has deployed to [PyPI](https://pypi.org/project/pylast/#history) has deployed to [PyPI](https://pypi.org/project/pylast/#history)
* [ ] Check installation: - [ ] Check installation:
```bash ```bash
pip3 uninstall -y pylast && pip3 install -U pylast && python3 -c "import pylast; print(pylast.__version__)" pip3 uninstall -y pylast && pip3 install -U pylast && python3 -c "import pylast; print(pylast.__version__)"

13
tox.ini
View file

@ -1,5 +1,6 @@
[tox] [tox]
envlist = envlist =
lint
py{py3, 310, 39, 38, 37, 36} py{py3, 310, 39, 38, 37, 36}
[testenv] [testenv]
@ -13,12 +14,6 @@ extras =
commands = commands =
pytest -v -s -W all --cov pylast --cov tests --cov-report term-missing --random-order {posargs} pytest -v -s -W all --cov pylast --cov tests --cov-report term-missing --random-order {posargs}
[testenv:venv]
deps =
ipdb
commands =
{posargs}
[testenv:lint] [testenv:lint]
passenv = passenv =
PRE_COMMIT_COLOR PRE_COMMIT_COLOR
@ -27,3 +22,9 @@ deps =
pre-commit pre-commit
commands = commands =
pre-commit run --all-files --show-diff-on-failure pre-commit run --all-files --show-diff-on-failure
[testenv:venv]
deps =
ipdb
commands =
{posargs}