Skip to content

Use pyproject.toml #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
# remove pygfx from install_requires, we install using pygfx@main
sed -i "/pygfx/d" ./setup.py
sed -i "/pygfx/d" ./pyproject.toml
pip install git+https://github.com/pygfx/pygfx.git@main
- name: Install fastplotlib
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
# remove pygfx from install_requires, we install using pygfx@main
sed -i "/pygfx/d" ./setup.py
sed -i "/pygfx/d" ./pyproject.toml
pip install git+https://github.com/pygfx/pygfx.git@main
pip install -e ".[docs,notebook,imgui]"
- name: Show wgpu backend
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
# any push to main goes to fastplotlib.org/ver/dev
run: echo "DOCS_VERSION_DIR=dev" >> "$GITHUB_ENV"

# upload docs via SCP
- name: Deploy docs
uses: appleboy/scp-action@v0.1.7
Expand All @@ -90,7 +90,7 @@ jobs:
with:
message: |
📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/${{ env.DOCS_VERSION_DIR }}

# upload docs via SCP
- name: Deploy docs release
if: ${{ github.ref_type == 'tag' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
# remove pygfx from install_requires, we install using pygfx@main
sed -i "/pygfx/d" ./setup.py
sed -i "/pygfx/d" ./pyproject.toml
pip install git+https://github.com/pygfx/pygfx.git@main
- name: Install fastplotlib
run: |
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion fastplotlib/VERSION

This file was deleted.

5 changes: 2 additions & 3 deletions fastplotlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from pathlib import Path

from ._version import __version__, version_info

# this must be the first import for auto-canvas detection
from .utils import loop # noqa
from .graphics import *
Expand All @@ -20,9 +22,6 @@
from .utils import config, enumerate_adapters, select_adapter, print_wgpu_report


with open(Path(__file__).parent.joinpath("VERSION"), "r") as f:
__version__ = f.read().split("\n")[0]

if len(enumerate_adapters()) < 1:
from warnings import warn

Expand Down
5 changes: 5 additions & 0 deletions fastplotlib/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__version__ = "0.5.0"

version_info = tuple(
int(i) if i.isnumeric() else i for i in __version__.split("+")[0].split(".")
)
24 changes: 12 additions & 12 deletions fastplotlib/layouts/_graphic_methods_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def add_image(
interpolation: str = "nearest",
cmap_interpolation: str = "linear",
isolated_buffer: bool = True,
**kwargs
**kwargs,
) -> ImageGraphic:
"""

Expand Down Expand Up @@ -78,7 +78,7 @@ def add_image(
interpolation,
cmap_interpolation,
isolated_buffer,
**kwargs
**kwargs,
)

def add_line_collection(
Expand All @@ -96,7 +96,7 @@ def add_line_collection(
metadatas: Union[Sequence[Any], numpy.ndarray] = None,
isolated_buffer: bool = True,
kwargs_lines: list[dict] = None,
**kwargs
**kwargs,
) -> LineCollection:
"""

Expand Down Expand Up @@ -169,7 +169,7 @@ def add_line_collection(
metadatas,
isolated_buffer,
kwargs_lines,
**kwargs
**kwargs,
)

def add_line(
Expand All @@ -183,7 +183,7 @@ def add_line(
cmap_transform: Union[numpy.ndarray, Iterable] = None,
isolated_buffer: bool = True,
size_space: str = "screen",
**kwargs
**kwargs,
) -> LineGraphic:
"""

Expand Down Expand Up @@ -234,7 +234,7 @@ def add_line(
cmap_transform,
isolated_buffer,
size_space,
**kwargs
**kwargs,
)

def add_line_stack(
Expand All @@ -253,7 +253,7 @@ def add_line_stack(
separation: float = 10.0,
separation_axis: str = "y",
kwargs_lines: list[dict] = None,
**kwargs
**kwargs,
) -> LineStack:
"""

Expand Down Expand Up @@ -334,7 +334,7 @@ def add_line_stack(
separation,
separation_axis,
kwargs_lines,
**kwargs
**kwargs,
)

def add_scatter(
Expand All @@ -349,7 +349,7 @@ def add_scatter(
sizes: Union[float, numpy.ndarray, Iterable[float]] = 1,
uniform_size: bool = False,
size_space: str = "screen",
**kwargs
**kwargs,
) -> ScatterGraphic:
"""

Expand Down Expand Up @@ -409,7 +409,7 @@ def add_scatter(
sizes,
uniform_size,
size_space,
**kwargs
**kwargs,
)

def add_text(
Expand All @@ -422,7 +422,7 @@ def add_text(
screen_space: bool = True,
offset: tuple[float] = (0, 0, 0),
anchor: str = "middle-center",
**kwargs
**kwargs,
) -> TextGraphic:
"""

Expand Down Expand Up @@ -473,5 +473,5 @@ def add_text(
screen_space,
offset,
anchor,
**kwargs
**kwargs,
)
83 changes: 82 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
# ===== Project info

[project]
dynamic = ["version"]
name = "fastplotlib"
description = "Next-gen fast plotting library running on WGPU using the Pygfx rendering engine "
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "Kushal Kolar" }, { name = "Caitlin Lewis" }]
keywords = [
"visualization",
"science",
"interactive",
"pygfx",
"webgpu",
"wgpu",
"vulkan",
"gpu",
]
requires-python = ">= 3.10"
dependencies = [
"numpy>=1.23.0",
"pygfx>=0.9.0",
"wgpu>=0.20.0",
"cmap>=0.1.3",
# (this comment keeps this list multiline in VSCode)
]

[project.optional-dependencies]
docs = [
"sphinx",
"sphinx-gallery",
"pydata-sphinx-theme",
"glfw",
"ipywidgets>=8.0.0,<9",
"sphinx-copybutton",
"sphinx-design",
"pandoc",
"imageio[ffmpeg]",
"matplotlib",
"scikit-learn",
]
notebook = [
"jupyterlab",
"jupyter-rfb>=0.5.1",
"ipywidgets>=8.0.0,<9",
"sidecar",
]
tests = [
"pytest",
"nbmake",
"black",
"scipy",
"imageio[ffmpeg]",
"scikit-learn",
"tqdm",
]
imgui = ["imgui-bundle"]
dev = ["fastplotlib[docs,notebook,tests,imgui]"]

[project.urls]
Homepage = "https://www.fastplotlib.org/"
Documentation = "https://www.fastplotlib.org/"
Repository = "https://github.com/fastplotlib/fastplotlib"

# ===== Building

[build-system]
requires = ["setuptools", "wheel"]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

# ===== Tooling

# [tool.ruff]
# line-length = 88

# [tool.ruff.lint]
# select = ["F", "E", "W", "N", "B", "RUF", "TC"]
# ignore = [
# "E501", # Line too long
# "E731", # Do not assign a `lambda` expression, use a `def`
# "B019", # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
# "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`"
# ]
76 changes: 0 additions & 76 deletions setup.py

This file was deleted.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy