Skip to content

Commit 474101c

Browse files
committed
fix: adding pyproject.toml
1 parent ac99448 commit 474101c

File tree

2 files changed

+146
-68
lines changed

2 files changed

+146
-68
lines changed

pyproject.toml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
[build-system]
2+
requires = ['setuptools']
3+
build-backend = 'setuptools.build_meta'
4+
5+
[project]
6+
name = 'LoopStructural'
7+
description = '3D geological modelling'
8+
authors = [{ name = 'Lachlan Grose', email = 'lachlan.grose@monash.edu' }]
9+
readme = 'README.md'
10+
requires-python = '>=3.8'
11+
keywords = [
12+
"earth sciences",
13+
"geology",
14+
"3-D modelling",
15+
"structural geology",
16+
"uncertainty",
17+
]
18+
license = { text = 'MIT' }
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 = [
34+
"numpy>=1.18",
35+
"pandas",
36+
"scipy",
37+
"scikit-image",
38+
"scikit-learn",
39+
"tqdm",
40+
]
41+
dynamic = ['version']
42+
43+
[project.optional-dependencies]
44+
45+
46+
[project.urls]
47+
Documentation = 'https://Loop3d.org/LoopStructural/'
48+
"Bug Tracker" = 'https://github.com/loop3d/loopstructural/issues'
49+
"Source Code" = 'https://github.com/loop3d/loopstructural'
50+
51+
[tool.setuptools.dynamic]
52+
version = { attr = 'LoopStructural.version.__version__' }
53+
54+
[tool.setuptools.packages.find]
55+
include = ['LoopStructural']
56+
57+
[tool.setuptools.package-data]
58+
LoopStructural = [
59+
"datasets/data/fault_trace/*",
60+
"datasets/data/*.csv",
61+
"datasets/data/*.txt",
62+
"datasets/data/geological_map_data/*.csv",
63+
"datasets/data/geological_map_data/*.txt",
64+
]
65+
66+
[tool.isort]
67+
profile = 'black'
68+
line_length = 100
69+
# Sort by name, don't cluster "from" vs "import"
70+
force_sort_within_sections = true
71+
# Combines "as" imports on the same line
72+
combine_as_imports = true
73+
74+
[tool.black]
75+
line-length = 100
76+
skip-string-normalization = true
77+
target-version = ['py39']
78+
exclude = '\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules'
79+
80+
[tool.blackdoc]
81+
# From https://numpydoc.readthedocs.io/en/latest/format.html
82+
# Extended discussion: https://github.com/pyvista/pyvista/pull/4129
83+
# The length of docstring lines should be kept to 75 characters to facilitate
84+
# reading the docstrings in text terminals.
85+
line-length = 75
86+
87+
[tool.build_sphinx]
88+
source-dir = 'doc'
89+
build-dir = './doc/build'
90+
all_files = 1
91+
92+
[tool.upload_sphinx]
93+
upload-dir = 'doc/build/html'
94+
95+
[tool.pydocstyle]
96+
match = '(?!coverage).*.py'
97+
convention = "numpy"
98+
add-ignore = ["D404"]
99+
100+
[tool.codespell]
101+
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/*'
102+
quiet-level = 3
103+
104+
105+
[tool.ruff]
106+
exclude = ['.git', 'pycache__', 'build', 'dist', 'doc/examples', 'doc/_build']
107+
external = ["E131", "D102", "D105"]
108+
line-length = 100
109+
indent-width = 4
110+
target-version = 'py39'
111+
112+
[tool.ruff.lint]
113+
ignore = [
114+
# whitespace before ':'
115+
"E203",
116+
# line break before binary operator
117+
# "W503",
118+
# line length too long
119+
"E501",
120+
# do not assign a lambda expression, use a def
121+
"E731",
122+
# too many leading '#' for block comment
123+
"E266",
124+
# ambiguous variable name
125+
"E741",
126+
# module level import not at top of file
127+
"E402",
128+
# Quotes (temporary)
129+
"Q0",
130+
# bare excepts (temporary)
131+
# "B001", "E722",
132+
"E722",
133+
# we already check black
134+
# "BLK100",
135+
# 'from module import *' used; unable to detect undefined names
136+
"F403",
137+
]
138+
fixable = ["ALL"]
139+
unfixable = []
140+
extend-select = ["B007", "B010", "C4", "F", "NPY", "PGH004", "RSE", "RUF100"]
141+
142+
[tool.ruff.lint.flake8-comprehensions]
143+
allow-dict-calls-with-keyword-arguments = true

setup.py

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
# setup cython code
2-
import sys
1+
"""See pyproject.toml for project metadata."""
32

4-
try:
5-
from setuptools import setup, find_packages
6-
except:
7-
raise RuntimeError("Cannot import setuptools \n" "python -m pip install setuptools")
8-
sys.exit(1)
9-
10-
11-
try:
12-
import numpy
13-
except:
14-
raise RuntimeError("Cannot import numpy \n" "python -m pip install numpy")
15-
sys.exit(1)
16-
17-
import numpy
3+
from setuptools import setup
184
import os
195
import codecs
206

@@ -24,55 +10,4 @@
2410
with open(os.path.join(package_root, "LoopStructural/version.py")) as fp:
2511
exec(fp.read(), version)
2612
version = version["__version__"]
27-
28-
setup(
29-
name="LoopStructural",
30-
install_requires=[
31-
"numpy>=1.18",
32-
"pandas",
33-
"scipy",
34-
"scikit-image",
35-
"scikit-learn",
36-
"tqdm",
37-
],
38-
description="Open source 3D structural geology modelling",
39-
long_description=codecs.open("README.md", "r", "utf-8").read(),
40-
author="Lachlan Grose",
41-
author_email="lachlan.grose@monash.edu",
42-
license=("MIT"),
43-
url="https://loop3d.github.io/LoopStructural/",
44-
classifiers=[
45-
"Development Status :: 4 - Beta",
46-
"Intended Audience :: Developers",
47-
"Intended Audience :: Other Audience",
48-
"Intended Audience :: Science/Research",
49-
"License :: OSI Approved :: MIT License",
50-
"License :: Free for non-commercial use",
51-
"Natural Language :: English",
52-
"Programming Language :: Python",
53-
"Programming Language :: Python :: 3",
54-
"Topic :: Multimedia :: Graphics :: 3D Modeling",
55-
"Topic :: Scientific/Engineering",
56-
"Topic :: Scientific/Engineering :: GIS",
57-
],
58-
version=version,
59-
packages=find_packages(),
60-
include_dirs=[numpy.get_include()],
61-
include_package_data=True,
62-
package_data={
63-
"LoopStructural": [
64-
"datasets/data/fault_trace/*",
65-
"datasets/data/*.csv",
66-
"datasets/data/*.txt",
67-
"datasets/data/geological_map_data/*.csv",
68-
"datasets/data/geological_map_data/*.txt",
69-
]
70-
},
71-
keywords=[
72-
"earth sciences",
73-
"geology",
74-
"3-D modelling",
75-
"structural geology",
76-
"uncertainty",
77-
],
78-
)
13+
setup()

0 commit comments

Comments
 (0)