Skip to content

Commit

Permalink
Merge pull request #160 from kyleaoman/pyproject_toml
Browse files Browse the repository at this point in the history
Move from setup.py to pyproject.toml
  • Loading branch information
JBorrow authored Jul 6, 2023
2 parents 068d08e + 58d9601 commit a5e9fae
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 527 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
python-version: [3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Temporary files
*~
\#*
.\#*

# Python environment.
env/*

Expand Down
2 changes: 0 additions & 2 deletions docs/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ Optional packages
that do not store this variable in the snapshots (e.g. dark matter)
+ ``tqdm``, required for progress bars for some long-running tasks. If not installed
no progress bar will be shown.
+ ``py-sphviewer``, if you wish to use our integration with this visualisation
code.


Installing
Expand Down
3 changes: 0 additions & 3 deletions docs/source/visualisation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ The output of these functions comes with associated units and has the correct
dimensions. There are lower-level APIs (also documented here) that provide
additional functionality.

Finally, we also describe here the integration with :mod:`py-sphviewer`.

.. toctree::
:maxdepth: 2

projection
slice
volume_render
tools
py-sphviewer

40 changes: 0 additions & 40 deletions docs/source/visualisation/py-sphviewer.rst

This file was deleted.

2 changes: 1 addition & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
black="./black_formatting_env/bin/python3 -m black"

# Formatting command
files=$(echo {*.py,tests/*.py,swiftsimio/*.py,swiftsimio/*/*.py,swiftsimio/*/*/*.py})
files=$(echo {tests/*.py,swiftsimio/*.py,swiftsimio/*/*.py,swiftsimio/*/*/*.py})
cmd="$black -t py38 $files"

# Print the help
Expand Down
1 change: 0 additions & 1 deletion optional_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
numba
pytest
black
py-sphviewer
matplotlib
scipy
wily
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["swiftsimio"]

[project]
name = "swiftsimio"
version="6.1.1"
authors = [
{ name="Josh Borrow", email="[email protected]" },
]
description="SWIFTsim (swift.dur.ac.uk) i/o routines for python."
readme = "README.md"
requires-python = ">3.8.0"
classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Operating System :: OS Independent",
]
dependencies = [
"numpy",
"h5py",
"unyt>=2.9.0",
"numba>=0.50.0",
]

[project.urls]
"Homepage" = "https://github.com/SWIFTSIM/swiftsimio"
"Bug Tracker" = "https://github.com/SWIFTSIM/swiftsimio/issues"
"Documentation" = "https://swiftsimio.readthedocs.io/en/latest"

[project.scripts]
swiftsnap = "swiftsimio.swiftsnap:swiftsnap"
79 changes: 0 additions & 79 deletions scripts/benchmark_visualisation.py

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

11 changes: 0 additions & 11 deletions swiftsimio/optional_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
+ tqdm: progress bars
+ scipy.spatial: KDTrees
+ sphviewer: visualisation
+ numba/cuda: visualisation
"""

Expand All @@ -30,16 +29,6 @@ def tqdm(x, *args, **kwargs):
TREE_AVAILABLE = False


# Py-sphviewer
try:
import sphviewer as viewer

SPHVIEWER_AVAILABLE = True
except (ImportError, ModuleNotFoundError):
viewer = None
SPHVIEWER_AVAILABLE = False


# Astropy
try:
import astropy
Expand Down
7 changes: 6 additions & 1 deletion swiftsnap → swiftsimio/swiftsnap.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def decode(bytestring: bytes) -> str:
),
)

if __name__ == "__main__":

def swiftsnap():
import swiftsimio as sw
import unyt

Expand Down Expand Up @@ -189,3 +190,7 @@ def decode(bytestring: bytes) -> str:
for name, scheme in data.subgrid_scheme.items():
if name != "NamedColumns":
print(f"{name.replace('Model', 'model')}: {decode(scheme)}")


if __name__ == "__main__":
swiftsnap()
Loading

0 comments on commit a5e9fae

Please sign in to comment.