Skip to content

Commit

Permalink
Switched to pyproject.toml based setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoitink committed Feb 19, 2024
1 parent 5e7fa38 commit cf58cc0
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 39 deletions.
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml # checks for correct yaml syntax for github actions ex.
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
57 changes: 57 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[build-system]
requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/simulatedmicroscopy/_version.py"

[tool.black]
line-length = 79
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']

[tool.ruff]
line-length = 79
select = [
"E", "F", "W", #flake8
"UP", # pyupgrade
"I", # isort
"BLE", # flake8-blind-exception
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"SIM", # flake8-simplify
]

ignore = [
"E501",
"E203",
"W503",
]

exclude = [
".bzr",
".direnv",
".eggs",
".git",
".mypy_cache",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"*vendored*",
"*_vendor*",
]

target-version = "py38"
fix = true
63 changes: 61 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,61 @@
[flake8]
ignore=E501,E203,W503
[metadata]
name = simulatedmicroscopy

description = Python package to create synthetic (fluorescence) microscopy images of (nano)particles and convolution with a point spread function
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/rhoitink/simulatedmicroscopy
author = Roy Hoitink
author_email = L.D.Hoitink@uu.nl
license = MIT
license_files = LICENSE
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Scientific/Engineering :: Image Processing
project_urls =
Bug Tracker = https://github.com/rhoitink/simulatedmicroscopy/issues
Documentation = https://github.com/rhoitink/simulatedmicroscopy#README.md
Source Code = https://github.com/rhoitink/simulatedmicroscopy
User Support = https://github.com/rhoitink/simulatedmicroscopy/issues

[options]
packages = find:
install_requires =
numpy
matplotlib
h5py
scipy
scikit-image>=0.20.0

python_requires = >=3.8
include_package_data = True
package_dir =
=src
setup_requires = setuptools_scm

[options.packages.find]
where = src

[options.extras_require]
dev =
black
flake8
pytest
pytest-cov
docs =
mkdocs
mkdocs-material
mkdocstrings[python]
mkdocs-gen-files
mkdocs-literate-nav
34 changes: 0 additions & 34 deletions setup.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
from .image import Image, HuygensImage
from .psf import HuygensPSF, GaussianPSF
from .particle import Sphere, Shell, PointParticle, Spherocylinder, Cube
try:
from ._version import version as __version__
except ImportError:
__version__ = "unknown"

__all__ = [
"Coordinates",
Expand All @@ -14,6 +18,4 @@
"Shell",
"Spherocylinder",
"Cube",
]

__version__ = "1.4.0"
]
16 changes: 16 additions & 0 deletions src/simulatedmicroscopy/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '1.4.1.dev7+g5e7fa38.d20240219'
__version_tuple__ = version_tuple = (1, 4, 1, 'dev7', 'g5e7fa38.d20240219')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cf58cc0

Please sign in to comment.