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

Deprecate setup.py, setup.cfg and use pyproject.toml #81

Merged
merged 11 commits into from
Apr 26, 2023
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
pip install black
- name: Run black
run: |
black --check --diff src/ tests/ setup.py
black --check --diff .

isort:
name: "ISort"
Expand All @@ -83,7 +83,7 @@ jobs:
pip install isort
- name: Run isort
run: |
isort --check-only --diff src/ tests/ setup.py
isort --check-only --diff .

ssort:
name: "SSort"
Expand All @@ -100,7 +100,7 @@ jobs:
pip install -e .
- name: Run ssort
run: |
ssort --check --diff src/ tests/ setup.py
ssort --check --diff src/ tests/

pyflakes:
name: "PyFlakes"
Expand All @@ -117,7 +117,7 @@ jobs:
pip install pyflakes
- name: Run pyflakes
run: |
pyflakes src/ tests/ setup.py
pyflakes src/ tests/

pylint:
name: "PyLint"
Expand All @@ -136,7 +136,7 @@ jobs:
pip install pylint
- name: Run pylint
run: |
pylint -E src/ tests/ setup.py
pylint -E src/ tests/

mypy:
name: "Mypy"
Expand All @@ -155,4 +155,4 @@ jobs:
pip install types-setuptools
- name: Run mypy
run: |
mypy src/ssort tests setup.py
mypy .
13 changes: 8 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ jobs:
runs-on: ubuntu-22.04
if: success() && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Build source distribution
- name: Install dependencies
run: |
python setup.py sdist
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build --sdist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ We recommend that you reformat using `isort <https://pycqa.github.io/isort/>`_ a

.. code:: bash

$ ssort src/ tests/ setup.py; isort src/ tests/ setup.py; black src/ tests/ setup.py
bwhmather marked this conversation as resolved.
Show resolved Hide resolved
$ ssort src/ tests/; isort src/ tests/; black src/ tests/

You can also setup ssort to run automatically before commit by setting up `pre-commit <https://pre-commit.com/index.html>`_,
and registering ssort in your `.pre-commit-config.yaml`.
Expand Down
72 changes: 69 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,77 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=61.2"
]

[project]
authors = [
{email = "[email protected]", name = "Ben Mather"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance"
]
dependencies = [
"pathspec >=0.9.0"
]
description = "The python statement sorter"
dynamic = [
"version"
]
maintainers = [
{email = "[email protected]", name = "Ben Mather"}
]
name = "ssort"
readme = "README.rst"
requires-python = ">=3.8"

[project.license]
text = "MIT"

[project.scripts]
ssort = "ssort._main:main"

[project.urls]
Homepage = "https://github.com/bwhmather/ssort"

[tool.black]
force-exclude = 'test_data/samples/*'
line_length = 79

[tool.distutils.bdist_wheel]
universal = 1

[tool.isort]
profile = "black"
multi_line_output = 3
extend_skip = ["test_data/samples"]
line_length = 79
multi_line_output = 3
profile = "black"

[tool.mypy]
exclude = "test_data/samples/*"

[[tool.mypy.overrides]]
module = "pathspec"
ignore_missing_imports = true
module = "pathspec"

[tool.setuptools]
include-package-data = false
license-files = [
"LICENSE"
]

[tool.setuptools.dynamic.version]
attr = "ssort.__version__"

[tool.setuptools.packages.find]
where = ["src"]
43 changes: 0 additions & 43 deletions setup.cfg

This file was deleted.

8 changes: 0 additions & 8 deletions setup.py

This file was deleted.

13 changes: 7 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tox]
envlist = py38,py39,py310,black,isort,ssort,pyflakes,pylint,mypy
isolated_build = true

[testenv]
deps =
Expand All @@ -12,25 +13,25 @@ deps =
black
skip_install = True
commands =
black --check src/ssort tests setup.py
black --check .

[testenv:isort]
deps =
isort
skip_install = True
commands =
isort --check-only src/ssort tests setup.py
isort --check-only .

[testenv:ssort]
commands =
ssort --check --diff src/ssort tests setup.py
ssort --check --diff src/ssort tests
bwhmather marked this conversation as resolved.
Show resolved Hide resolved

[testenv:pyflakes]
deps =
pyflakes
skip_install = True
commands =
pyflakes src/ssort tests setup.py
pyflakes src/ssort tests

[testenv:pylint]
deps =
Expand All @@ -39,7 +40,7 @@ deps =
extras=
test
commands =
pylint -E src/ssort tests setup.py
pylint -E src/ssort tests

[testenv:mypy]
deps =
Expand All @@ -48,4 +49,4 @@ deps =
types-setuptools
skip_install = True
commands =
mypy src/ssort tests setup.py
mypy .