This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to poetry and automated relases via Github UI (#614)
* Move to poetry and automated relases via Github UI * Bump release notes to 6.2.0 * Fix readthedocs PR builds
- Loading branch information
Showing
15 changed files
with
214 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: Test PyPI publish | ||
|
||
on: | ||
release: | ||
types: [prereleased] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: pypi-dev | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.7" | ||
cache: "poetry" | ||
|
||
- name: Install dependencies | ||
run: | | ||
poetry env use "3.7" | ||
poetry install | ||
- name: Bump version number | ||
run: poetry version ${{ github.event.release.tag_name }} | ||
|
||
- name: Build package | ||
run: poetry build | ||
|
||
- name: Publish package | ||
run: poetry publish -r testpypi -u __token__ -p ${{ secrets.TEST_PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,37 @@ | ||
name: Release | ||
--- | ||
name: PyPI publish | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.11" | ||
|
||
permissions: | ||
contents: read | ||
types: [released] | ||
|
||
jobs: | ||
release-pypi: | ||
name: Upload release to PyPI | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi-prod | ||
url: https://pypi.org/project/pydocstyle/ | ||
environment: pypi-prod | ||
steps: | ||
- name: Check out code from Github | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/[email protected] | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
check-latest: true | ||
- name: Install requirements | ||
run: | | ||
python -m pip install twine build | ||
- name: Build distributions | ||
run: | | ||
python -m build | ||
- name: Upload to PyPI | ||
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
env: | ||
TWINE_REPOSITORY: pypi | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
python-version: "3.7" | ||
cache: "poetry" | ||
|
||
- name: Install dependencies | ||
run: | | ||
twine upload --verbose dist/* | ||
poetry env use "3.7" | ||
poetry install | ||
- name: Bump version number | ||
run: poetry version ${{ github.event.release.tag_name }} | ||
|
||
- name: Build package | ||
run: poetry build | ||
|
||
- name: Publish package | ||
run: poetry publish -u __token__ -p ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
[tool.poetry] | ||
name = "pydocstyle" | ||
version = "0.0.0-dev" | ||
description = "Python docstring style checker" | ||
authors = ["Amir Rachum <[email protected]>", "Sambhav Kothari <[email protected]"] | ||
license = "MIT" | ||
readme = "README.rst" | ||
documentation = "https://www.pydocstyle.org/en/stable/" | ||
homepage = "https://www.pydocstyle.org/en/stable/" | ||
repository = "https://github.com/PyCQA/pydocstyle" | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Environment :: Console", | ||
"Development Status :: 5 - Production/Stable", | ||
"Operating System :: OS Independent" | ||
] | ||
|
||
[tool.poetry.urls] | ||
"Release Notes" = "https://www.pydocstyle.org/en/stable/release_notes.html" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.6" | ||
snowballstemmer = ">=2.2.0" | ||
toml = {version = ">=0.10.2", optional = true} | ||
importlib-metadata = {version = ">=2.0.0,<5.0.0", python = "<3.8"} | ||
|
||
[tool.poetry.extras] | ||
toml = ["toml"] | ||
|
||
[tool.poetry.scripts] | ||
pydocstyle = "pydocstyle.cli:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.black] | ||
line-length = 79 | ||
target-version = ['py36'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
snowballstemmer==1.2.1 | ||
toml==0.10.2 | ||
snowballstemmer>=1.2.1 | ||
toml>=0.10.2 | ||
importlib-metadata<5.0.0,>=2.0.0; python_version < "3.8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from ._version import __version__ | ||
|
||
# Temporary hotfix for flake8-docstrings | ||
from .checker import ConventionChecker, check | ||
from .parser import AllError | ||
from .utils import __version__ | ||
from .violations import Error, conventions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import sys | ||
|
||
if sys.version_info[:2] >= (3, 8): | ||
from importlib import metadata | ||
else: | ||
import importlib_metadata as metadata # pragma: no cover | ||
|
||
# Used to automatically set version number from github actions | ||
# as well as not break when being tested locally | ||
try: | ||
__version__ = metadata.version(__package__) | ||
except metadata.PackageNotFoundError: # pragma: no cover | ||
__version__ = "0.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.