Skip to content

Commit c344ebb

Browse files
authored
fix: migrating from setup.py to pyproject.toml (#5)
1 parent ed25d4d commit c344ebb

File tree

2 files changed

+127
-25
lines changed

2 files changed

+127
-25
lines changed

pyproject.toml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "LoopProjectFile"
7+
description = "Open source structural geology data storage for Loop Projects"
8+
authors = [{ name = "Roy Thomson", email = "roy.thomson@monash.edu" }]
9+
license = { text = 'MIT' }
10+
keywords = [
11+
"earth sciences",
12+
"data storage",
13+
"structural geology",
14+
"geology",
15+
"loop3d",
16+
]
17+
readme = 'README.md'
18+
requires-python = ">=3.8"
19+
classifiers = [
20+
'Development Status :: 5 - Production/Stable',
21+
'Intended Audience :: Science/Research',
22+
'Topic :: Scientific/Engineering :: Information Analysis',
23+
'License :: OSI Approved :: MIT License',
24+
'Operating System :: Microsoft :: Windows',
25+
'Operating System :: POSIX',
26+
'Operating System :: MacOS',
27+
'Programming Language :: Python :: 3.8',
28+
'Programming Language :: Python :: 3.9',
29+
'Programming Language :: Python :: 3.10',
30+
'Programming Language :: Python :: 3.11',
31+
'Programming Language :: Python :: 3.12',
32+
]
33+
dependencies = ["numpy", "pandas", "netCDF4"]
34+
dynamic = ['version']
35+
36+
[project.urls]
37+
Documentation = 'https://Loop3d.org/LoopProjectFile/'
38+
"Bug Tracker" = 'https://github.com/loop3d/LoopProjectFile/issues'
39+
"Source Code" = 'https://github.com/loop3d/LoopProjectFile'
40+
41+
[tool.setuptools.dynamic]
42+
version = { attr = 'LoopProjectFile.version.__version__' }
43+
44+
[tool.setuptools.packages.find]
45+
include = ['LoopProjectFile']
46+
47+
48+
[tool.isort]
49+
profile = 'black'
50+
line_length = 100
51+
# Sort by name, don't cluster "from" vs "import"
52+
force_sort_within_sections = true
53+
# Combines "as" imports on the same line
54+
combine_as_imports = true
55+
56+
[tool.black]
57+
line-length = 100
58+
skip-string-normalization = true
59+
target-version = ['py39']
60+
exclude = '\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules'
61+
62+
[tool.blackdoc]
63+
# From https://numpydoc.readthedocs.io/en/latest/format.html
64+
# Extended discussion: https://github.com/pyvista/pyvista/pull/4129
65+
# The length of docstring lines should be kept to 75 characters to facilitate
66+
# reading the docstrings in text terminals.
67+
line-length = 75
68+
69+
[tool.build_sphinx]
70+
source-dir = 'doc'
71+
build-dir = './doc/build'
72+
all_files = 1
73+
74+
[tool.upload_sphinx]
75+
upload-dir = 'doc/build/html'
76+
77+
[tool.pydocstyle]
78+
match = '(?!coverage).*.py'
79+
convention = "numpy"
80+
add-ignore = ["D404"]
81+
82+
[tool.codespell]
83+
skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.ply,*.vtk,*.vti,*.vtu,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,doc/_build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/examples/*,*.mypy_cache/*,*cover,./tests/tinypages/_build/*,*/_autosummary/*'
84+
quiet-level = 3
85+
86+
87+
[tool.ruff]
88+
exclude = ['.git', 'pycache__', 'build', 'dist', 'doc/examples', 'doc/_build']
89+
external = ["E131", "D102", "D105"]
90+
line-length = 100
91+
indent-width = 4
92+
target-version = 'py39'
93+
94+
[tool.ruff.lint]
95+
ignore = [
96+
# whitespace before ':'
97+
"E203",
98+
# line break before binary operator
99+
# "W503",
100+
# line length too long
101+
"E501",
102+
# do not assign a lambda expression, use a def
103+
"E731",
104+
# too many leading '#' for block comment
105+
"E266",
106+
# ambiguous variable name
107+
"E741",
108+
# module level import not at top of file
109+
"E402",
110+
# Quotes (temporary)
111+
"Q0",
112+
# bare excepts (temporary)
113+
# "B001", "E722",
114+
"E722",
115+
# we already check black
116+
# "BLK100",
117+
# 'from module import *' used; unable to detect undefined names
118+
"F403",
119+
]
120+
fixable = ["ALL"]
121+
unfixable = []
122+
extend-select = ["B007", "B010", "C4", "F", "NPY", "PGH004", "RSE", "RUF100"]
123+
124+
[tool.ruff.lint.flake8-comprehensions]
125+
allow-dict-calls-with-keyword-arguments = true

setup.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import setup
22
import os
33

44
package_root = os.path.abspath(os.path.dirname(__file__))
@@ -8,27 +8,4 @@
88
exec(fp.read(), version)
99
version = version["__version__"]
1010

11-
setup(
12-
name="LoopProjectFile",
13-
install_requires=["netCDF4>=1.5.4", "numpy", "pandas"],
14-
description="Open source structural geology data storage for Loop Projects",
15-
author="Roy Thomson",
16-
author_email="roy.thomson@monash.edu",
17-
url="https://github.com/Loop3D/LoopProjectFile",
18-
classifiers=[
19-
"Development Status :: 3 - Alpha",
20-
"Intended Audience :: Developers",
21-
"Intended Audience :: Other Audience",
22-
"Intended Audience :: Science/Research",
23-
"License :: OSI Approved :: MIT License",
24-
"License :: Free for non-commercial use",
25-
"Natural Language :: English",
26-
"Programming Language :: Python",
27-
"Programming Language :: Python :: 3",
28-
"Topic :: Multimedia :: Graphics :: 3D Modeling",
29-
"Topic :: Scientific/Engineering",
30-
"Topic :: Scientific/Engineering :: GIS",
31-
],
32-
version=version,
33-
packages=find_packages(),
34-
)
11+
setup()

0 commit comments

Comments
 (0)