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

PEP 621: Migrate to pyproject.toml #140

Merged
merged 1 commit into from Sep 17, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flake8
@@ -0,0 +1,3 @@
[flake8]
ignore = E203,W503
max-line-length = 88
4 changes: 3 additions & 1 deletion .github/workflows/main.yaml
Expand Up @@ -33,8 +33,10 @@ jobs:

- run: pip install .

- run: pip install pytest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have pyproject perhaps we can migrate to poetry to manage dev dependencies too. No need to do it as part of this PR though.


- name: run tests
run: python setup.py test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that setup.py is gone, how should we release? Can you also update the workflow declared in upload-to-pypi.yaml?

run: pytest

lint:
name: pre-commit
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -42,7 +42,7 @@ repos:
hooks:
- id: black

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.0.0
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.10.1
hooks:
- id: setup-cfg-fmt
- id: validate-pyproject
50 changes: 50 additions & 0 deletions pyproject.toml
@@ -0,0 +1,50 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "autoflake"
description = "Removes unused imports and unused variables"
license = {text = "MIT"}
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Quality Assurance",
]
keywords = ["clean", "fix", "automatic", "unused", "import"]
urls = {Homepage = "https://www.github.com/PyCQA/autoflake"}
requires-python = ">=3.7"
dependencies = [
"pyflakes>=1.1.0",
"tomli>=2.0.1;python_version<'3.11'",
]
dynamic = ["version"]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.scripts]
autoflake = "autoflake:main"

[tool.setuptools]
py-modules = ["autoflake"]
# test-suite = "test_autoflake" # Deprecated since setuptools v41.5.0
license-files = ["LICENSE"]
include-package-data = false

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools.dynamic]
version = {attr = "autoflake.__version__"}

[tool.distutils.bdist_wheel]
universal = 1

[tool.flake8]
ignore = "E203,W503"
max-line-length = "88"
38 changes: 0 additions & 38 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.