Skip to content

Commit d8cbc2f

Browse files
Copilotcokelaer
andcommitted
Migrate from setup.py to pyproject.toml
Co-authored-by: cokelaer <778821+cokelaer@users.noreply.github.com>
1 parent d95d723 commit d8cbc2f

3 files changed

Lines changed: 66 additions & 70 deletions

File tree

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Build source tarball
2424
run: |
2525
rm -rf dist;
26-
python setup.py sdist
26+
python -m build
2727
2828
- name: Publish distribution to Test PyPI
2929
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "spectrum"
7+
version = "0.10.0"
8+
description = "Spectrum Analysis Tools"
9+
readme = "README.rst"
10+
license = { text = "new BSD" }
11+
authors = [
12+
{ name = "Thomas Cokelaer", email = "cokelaer@gmail.com" }
13+
]
14+
keywords = ["signal", "spectrum", "analysis"]
15+
classifiers = [
16+
"Development Status :: 1 - Planning",
17+
"Environment :: Console",
18+
"Intended Audience :: Developers",
19+
"Intended Audience :: Education",
20+
"Intended Audience :: Financial and Insurance Industry",
21+
"Intended Audience :: Information Technology",
22+
"Intended Audience :: Science/Research",
23+
"Intended Audience :: Telecommunications Industry",
24+
"License :: OSI Approved :: BSD License",
25+
"Operating System :: POSIX :: Linux",
26+
"Operating System :: Unix",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
32+
"Topic :: Scientific/Engineering",
33+
]
34+
requires-python = ">=3.8"
35+
dependencies = [
36+
"easydev",
37+
"numpy",
38+
"scipy",
39+
"matplotlib",
40+
]
41+
42+
[project.optional-dependencies]
43+
testing = [
44+
"pytest",
45+
"pytest-cov",
46+
"pytest-xdist",
47+
"pytest-mock",
48+
"pytest-timeout",
49+
"pytest-runner",
50+
"coveralls",
51+
]
52+
doc = ["sphinx", "sphinx_rtd_theme"]
53+
54+
[project.urls]
55+
Homepage = "http://github.com/cokelaer/spectrum"
56+
57+
[tool.setuptools.packages.find]
58+
where = ["src"]
59+
60+
[tool.setuptools.package-data]
61+
"spectrum.data" = ["*"]
62+
63+
[tool.pytest.ini_options]
64+
addopts = "--durations=10 --verbose"

setup.py

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
1-
import glob
2-
import os
3-
import sys
4-
5-
pj = os.path.join
6-
7-
from setuptools import Extension, find_packages, setup
8-
9-
_MAJOR = 0
10-
_MINOR = 10
11-
_MICRO = 0
12-
version = "%d.%d.%d" % (_MAJOR, _MINOR, _MICRO)
13-
release = "%d.%d" % (_MAJOR, _MINOR)
14-
15-
16-
with open("README.rst") as f:
17-
readme = f.read()
18-
1+
from setuptools import Extension, setup
192

203
setup(
21-
name="spectrum",
22-
version=version,
23-
description="Spectrum Analysis Tools",
24-
long_description=readme,
25-
author="Thomas Cokelaer",
26-
author_email="cokelaer@gmail.com",
27-
url="http://github.com/cokelaer/spectrum",
28-
license="new BSD",
294
ext_modules=[
305
Extension(
316
"spectrum.mydpss",
@@ -35,47 +10,4 @@
3510
export_symbols=["multitap"],
3611
)
3712
],
38-
packages=find_packages("src"),
39-
package_dir={"": "src"},
40-
# Dependencies
41-
install_requires=open("requirements.txt").read(),
42-
extras_require={
43-
"plot": ["matplotlib"],
44-
"testing": [
45-
"pytest",
46-
"pytest-cov",
47-
"pytest-xdist",
48-
"pytest-mock",
49-
"pytest-timeout",
50-
"pytest-runner",
51-
"coveralls",
52-
],
53-
"doc": ["sphinx", "sphinx_rtd_theme"],
54-
},
55-
package_data={
56-
"spectrum.data": ["*"],
57-
},
58-
platforms=["Linux"],
59-
classifiers=[
60-
"Development Status :: 1 - Planning",
61-
"Environment :: Console",
62-
"Intended Audience :: Developers",
63-
"Intended Audience :: Education",
64-
"Intended Audience :: Financial and Insurance Industry",
65-
"Intended Audience :: Information Technology",
66-
"Intended Audience :: Science/Research",
67-
"Intended Audience :: Telecommunications Industry",
68-
"License :: OSI Approved :: BSD License",
69-
"Operating System :: POSIX :: Linux",
70-
"Operating System :: Unix",
71-
"Programming Language :: Python :: 2.7",
72-
"Programming Language :: Python :: 3.5",
73-
"Programming Language :: Python :: 3.7",
74-
"Programming Language :: Python :: 3.9",
75-
"Programming Language :: Python :: 3.10",
76-
"Programming Language :: Python :: 3.11",
77-
"Programming Language :: Python :: 3.12",
78-
"Programming Language :: Python :: 3.13",
79-
"Topic :: Scientific/Engineering",
80-
],
8113
)

0 commit comments

Comments
 (0)