Skip to content

Commit

Permalink
Move from setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
liskin committed Feb 24, 2023
1 parent b4ae748 commit 080cf6a
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 87 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ VENV_USE_SYSTEM_SITE_PACKAGES = $(wildcard $(VENV_SYSTEM_SITE_PACKAGES))
VENV_WHEEL = .venv-wheel
VENV_WHEEL_PYTHON = $(VENV_WHEEL)/bin/python

PACKAGE = $(eval PACKAGE := $$(subst -,_,$$(shell python3 -c 'import setuptools; setuptools.setup()' --name)))$(PACKAGE)
PACKAGE := $(shell sed -ne '/^name / { y/-/_/; s/^.*=\s*"\(.*\)"/\1/p }' pyproject.toml)

.PHONY: venv-system-site-packages
venv-system-site-packages:
Expand Down Expand Up @@ -101,6 +101,7 @@ endef
define VENV_CREATE_SYSTEM_SITE_PACKAGES
$(PYTHON) -m venv --system-site-packages --without-pip $(VENV)
$(VENV_PYTHON) -m pip --version || $(PYTHON) -m venv --system-site-packages $(VENV)
$(VENV_PYTHON) -m pip install 'pip >= 22.3' # PEP-660 (editable without setup.py)
touch $(VENV_SYSTEM_SITE_PACKAGES)
endef

Expand All @@ -112,7 +113,7 @@ $(VENV_DONE): export SETUPTOOLS_USE_DISTUTILS := stdlib
endif
endif

$(VENV_DONE): $(MAKEFILE_LIST) setup.py setup.cfg pyproject.toml
$(VENV_DONE): $(MAKEFILE_LIST) pyproject.toml
$(if $(VENV_USE_SYSTEM_SITE_PACKAGES),$(VENV_CREATE_SYSTEM_SITE_PACKAGES),$(VENV_CREATE))
$(VENV_PYTHON) -m pip install -e $(VENV_PIP_INSTALL)
touch $@
74 changes: 71 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,81 @@
[build-system]
requires = [
"setuptools >= 42",
"setuptools_scm[toml] >= 3.4",
"wheel",
"setuptools >= 64.0",
"setuptools_scm[toml] >= 6.2",
]
build-backend = "setuptools.build_meta"

[project]
name = "strava-offline"
dynamic = ["version"]
authors = [{name = "Tomáš Janoušek", email = "[email protected]"}]
license = {text = "MIT"}
description = "Leep a local mirror of Strava activities for further analysis/processing"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"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 :: Database",
"Topic :: Utilities",
]
urls = {Homepage = "https://github.com/liskin/strava-offline"}
requires-python = "~= 3.7"
dependencies = [
"PyYAML",
"bottle",
"click ~= 8.0",
"click-config-file",
"click-option-group",
"importlib-metadata; python_version<'3.10'",
"platformdirs >= 2.1",
"requests",
"requests_oauthlib",
"tabulate",
"typing-extensions", # python 3.7 compat
]

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

[project.optional-dependencies]
dev = [
"build >= 0.7",
"cram",
"flake8",
"isort >= 5.0",
"mypy >= 0.900",
"pyflakes >= 2.2.0",
"twine",
"types-PyYAML",
"types-requests",
"types-tabulate",
]
test = [
"pytest",
"pytest-recording",
"vcrpy >= 2.1.0",
]

[project.scripts]
strava-offline = "strava_offline.cli:cli"

[tool.setuptools_scm]

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.mypy]
python_executable = ".venv/bin/python3"
show_error_codes = true

[tool.isort]
profile = "open_stack"

Expand Down
78 changes: 0 additions & 78 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,81 +1,3 @@
[metadata]
name = strava-offline
url = https://github.com/liskin/strava-offline

author = Tomáš Janoušek
author_email = [email protected]
license = MIT

description = "Leep a local mirror of Strava activities for further analysis/processing"
long_description = file: README.md
long_description_content_type = text/markdown

classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
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 :: Database
Topic :: Utilities

[options]
package_dir =
=src
packages = find:
python_requires = ~= 3.7
install_requires =
PyYAML
bottle
click ~= 8.0
click-config-file
click-option-group
importlib-metadata; python_version<'3.10'
platformdirs >= 2.1
requests
requests_oauthlib
tabulate
typing-extensions # python 3.7 compat
tests_require =

[options.extras_require]
dev =
build >= 0.7
cram
flake8
isort >= 5.0
mypy >= 0.730
pyflakes >= 2.2.0
twine
types-PyYAML
types-requests
types-tabulate
test =
pytest
pytest-recording
vcrpy >= 2.1.0

[options.packages.find]
where=src

[options.package_data]
* =
py.typed

[options.entry_points]
console_scripts =
strava-offline = strava_offline.cli:cli

[mypy]
python_executable = .venv/bin/python3
show_error_codes = True

[flake8]
extend-exclude = .venv
max-line-length = 120

# vim:set et:
4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

0 comments on commit 080cf6a

Please sign in to comment.