Skip to content

Commit

Permalink
Update packaging setup (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus authored Sep 18, 2023
1 parent 9745275 commit e3db21c
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 146 deletions.
106 changes: 100 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,107 @@
[build-system]
requires = ['setuptools>=40.8.0', 'wheel>=0.33.0']
requires = ['setuptools>=61.0.0']
build-backend = "setuptools.build_meta"

[project]
name = "pythonfinder"
description = "A cross-platform python discovery tool to help locate python on any system."
authors = [{name = "Dan Ryan", email = "dan@danryan.co"}]
readme = "README.rst"
license = {text = "MIT"}
keywords = [
"pythonfinder",
"path",
"finder",
"pathfinder",
"which",
"pep514",
"pyenv",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"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",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
dynamic = ["version"]
requires-python = ">=3.7"
dependencies = [
"cached-property; python_version < \"3.8\"",
"packaging>=22.0",
"pydantic>=1.10.7,<2",
]

[project.optional-dependencies]
cli = ["click"]
tests = [
"pytest",
"pytest-cov",
"pytest-timeout",
"coverage<5",
]
dev = [
"parver",
"build",
"invoke",
"twine",
"lxml",
"pre-commit",
"towncrier",
]

[project.scripts]
pyfinder = "pythonfinder.cli:cli"

[project.urls]
Homepage = "https://github.com/sarugaku/pythonfinder"

[tool.setuptools]
zip-safe = true
package-data = { pythonfinder = ["LICENSE*", "README*"] }
package-dir = {"" = "src"}
license-files = ["LICENSE.txt"]

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

[tool.setuptools.packages.find]
where = ["src"]
exclude = [
"tests",
"docs",
"tasks",
]
namespaces = false

[tool.pytest.ini_options]
addopts = "-ra --timeout 300 --cov"
testpaths = ["tests/"]
norecursedirs = [".*", "build", "dist", "news", "tasks", "docs"]
markers = [
"parse",
"is_python",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]

[tool.mypy]
ignore_missing_imports = true
follow_imports = "skip"
html_report = "mypyhtml"
python_version = "3.7"

[tool.black]
line-length = 90
extend-exclude = '''
/(
src/pythonfinder/_vendor
)
'''

[tool.ruff]
target-version = "py37"
Expand Down
100 changes: 0 additions & 100 deletions setup.cfg

This file was deleted.

36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

5 changes: 4 additions & 1 deletion src/pythonfinder/models/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
Union,
)

from cached_property import cached_property
if sys.version_info >= (3, 8):
from functools import cached_property
else:
from cached_property import cached_property
from pydantic import Field, root_validator

from ..environment import (
Expand Down
4 changes: 2 additions & 2 deletions tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def build_dists(ctx, drop_existing=True):
if drop_existing:
drop_dist_dirs(ctx)
log("Building sdist using %s ...." % sys.executable)
ctx.run("%s setup.py sdist" % sys.executable)
ctx.run("%s -m build --sdist" % sys.executable)
log("Building wheel using %s ...." % sys.executable)
ctx.run("%s setup.py bdist_wheel" % sys.executable)
ctx.run("%s -m build --wheel" % sys.executable)


@invoke.task(build_dists)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ deps =
build
-e .[tests,cli]
commands =
python setup.py sdist
python -m build
twine check dist/*

0 comments on commit e3db21c

Please sign in to comment.