Skip to content

Commit

Permalink
Use project section in pyproject where possible (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-burst authored Jan 10, 2025
1 parent fac9016 commit c61fce2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ lint:
poetry run flake8 --jobs 4 --statistics --show-source $(CODE) tests scripts
poetry run pylint --jobs 4 --rcfile=setup.cfg $(CODE)
poetry run mypy $(CODE) tests scripts
poetry run black --target-version py38 --skip-string-normalization --check $(CODE) tests scripts
poetry run black --skip-string-normalization --check $(CODE) tests scripts
poetry run pytest --dead-fixtures --dup-fixtures

format:
poetry run isort $(CODE) tests scripts
poetry run black --target-version py38 --skip-string-normalization $(CODE) tests scripts
poetry run black --skip-string-normalization $(CODE) tests scripts
poetry run unify --in-place --recursive $(CODE) tests scripts

bump_major:
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
[tool.poetry]
[project]
name = "flake8-pytest-style"
version = "2.0.0"
description = "A flake8 plugin checking common style issues or inconsistencies with pytest-based tests."
authors = ["Mikhail Burshteyn <[email protected]>"]
authors = [
{ name = "Mikhail Burshteyn", email = "[email protected]" },
]
license = "MIT"
readme = 'README.md'
keywords = ["flake8", "pytest"]
dynamic = [
"classifiers",
"dependencies",
]
requires-python = ">=3.9"

[project.urls]
repository = "https://github.com/m-burst/flake8-pytest-style"
homepage = "https://pypi.org/project/flake8-pytest-style"
keywords = ["flake8", "pytest"]

[tool.poetry]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -21,7 +32,7 @@ classifiers = [
"Topic :: Software Development :: Testing :: Unit",
]

[tool.poetry.plugins."flake8.extension"]
[project.entry-points."flake8.extension"]
PT = 'flake8_pytest_style.plugin:PytestStylePlugin'

[tool.poetry.dependencies]
Expand Down
7 changes: 3 additions & 4 deletions scripts/pypi_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


def process_readme(readme: str, project_metadata: Container) -> str:
repository = cast(str, project_metadata['repository'])
urls = cast(Container, project_metadata['urls'])
repository = cast(str, urls['repository'])
version = cast(str, project_metadata['version'])
base_url = f'{repository}/blob/v{version}/'

Expand All @@ -27,9 +28,7 @@ def make_output_filename(input_filename: str) -> str:
def main() -> None:
with open('pyproject.toml') as pyproject_file:
pyproject_data = tomlkit.loads(pyproject_file.read())
project_metadata = cast(
Container, cast(Container, pyproject_data['tool'])['poetry']
)
project_metadata = cast(Container, pyproject_data['project'])

readme_filename = cast(str, project_metadata['readme'])
with open(readme_filename) as input_file:
Expand Down

0 comments on commit c61fce2

Please sign in to comment.