Skip to content

Commit

Permalink
Switch from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw committed Nov 19, 2023
1 parent d46174e commit b62e290
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 94 deletions.
9 changes: 4 additions & 5 deletions .drone.yml
Expand Up @@ -8,7 +8,6 @@ steps:
commands:
- curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-$(dpkg --print-architecture)" > "${HOME}/bin/cc-test-reporter"
- chmod +x "${HOME}/bin/cc-test-reporter"
- python setup.py develop
- pip install -r requirements-test.txt
- ruff check .
- mypy .
Expand All @@ -23,8 +22,8 @@ steps:
- name: Test Python Packaging
image: python:3.12
commands:
- pip install twine
- python setup.py sdist bdist_wheel
- pip install twine build
- python -m build
- twine check --strict dist/*

- name: Upload Python
Expand All @@ -38,8 +37,8 @@ steps:
from_secret: twine_password
image: python:3.12
commands:
- pip install twine
- python setup.py sdist bdist_wheel
- pip install twine build
- python -m build
- twine upload dist/*
when:
event:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -93,7 +93,6 @@ Development
-----------

```bash
python setup.py develop
pip install -r requirements-test.txt
ruff check .
mypy .
Expand All @@ -106,7 +105,7 @@ Publishing

```bash
pip install twine
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
```

Expand Down
4 changes: 2 additions & 2 deletions git_reviewers/tests/test.py
Expand Up @@ -143,12 +143,12 @@ def setUp(self) -> None:
self.finder = reviewers.FindLogReviewers(reviewers.Config())

def test_get_changed_files(self) -> None:
changed_files = ['README.rst', 'setup.py']
changed_files = ['README.rst', 'pyproject.toml']
self.finder.run_command = ( # type: ignore
MagicMock(return_value=changed_files)
)
files = self.finder.get_changed_files()
self.assertEqual(files, ['README.rst', 'setup.py'])
self.assertEqual(files, ['README.rst', 'pyproject.toml'])


class TestHistoricalReviewers(unittest.TestCase):
Expand Down
42 changes: 41 additions & 1 deletion pyproject.toml
@@ -1,5 +1,46 @@
[project]
name = "git-reviewers"
authors = [
{name = "Albert Wang", email = "git@albertyw.com"},
]
description = "Suggest reviewers for your git branch"
requires-python = ">=3.7"
keywords = ["git", "code", "review", "reviewer", "log", "history"]
license = {text = "MIT"}
classifiers = [
"Development Status :: r - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"Topic :: Software Development :: Version Control",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
]
dependencies = []
dynamic = ["version", "readme"]

[project.urls]
"Homepage" = "https://github.com/albertyw/git-reviewers"

[project.scripts]
git_reviewers = "git_reviewers.reviewers:main"

[tool.setuptools.dynamic]
version = {attr = "git_reviewers.reviewers.__version__"}
readme = {file = "README.md", content-type="text/markdown"}

[options.package_data]
git_reviewers = ["py.typed"]

[tool.ruff]
select = ["E", "F", "B"]
ignore = ["B010"]

[tool.mypy]
strict = true
Expand All @@ -14,7 +55,6 @@ source = [
]
omit = [
".virtualenv",
"setup.py",
]

[tool.coverage.report]
Expand Down
84 changes: 0 additions & 84 deletions setup.py

This file was deleted.

0 comments on commit b62e290

Please sign in to comment.