diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b5dba491..2316f228 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -42,8 +42,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install setuptools>=40.8.0 wheel pytest - python -m pip install . + python -m pip install -e .[dev] python -m pip freeze --all - name: Validate OpenCL diff --git a/README.md b/README.md index 265ed932..44c9611b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

Monte Carlo simulations of light transport made easy.

- +

This python package is an object-oriented implementation of Monte Carlo modeling for light transport in diffuse media. @@ -30,7 +30,14 @@ As discussed in the [why use this package](#why-use-this-package) section, compu - [Examples](#examples) ## Installation -Requires Python 3.6+ installed on the device. +Requires Python >=3.9 installed on the device. + +### Installing the latest release +> Currently, this `pip` version is outdated. We recommend installing the development version. +```shell +python -m pip install --upgrade pip +python -m pip install --upgrade pytissueoptics +``` ### Installing the development version 1. Clone the repository. @@ -39,14 +46,7 @@ Requires Python 3.6+ installed on the device. - On MacOS/Linux: `source venv/bin/activate`. - On Windows: `venv\Scripts\activate.bat`. 4. Upgrade `pip` with `pip install --upgrade pip`. -5. Install the package requirements with `pip install -r requirements.txt`. - -### Installing the previous release -> Currently, this `pip` version is outdated. We recommend installing the development version. -```shell -pip install --upgrade pip -pip install --upgrade pytissueoptics -``` +5. Install the package requirements with `python -m pip install -e .[dev]`. ## Getting started A command-line interface is available to help you run examples and tests. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e439b238 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ["setuptools>=77.0","setuptools_scm>=7"] +build-backend = "setuptools.build_meta" + +[project.urls] +GitHub = "https://github.com/DCC-Lab/PyTissueOptics" + +[project] +name = "pytissueoptics" +description = "Python module for 3D Monte Carlo Simulation of Light Propagation" +readme = "README.md" +authors = [ + { name = "Ludovick Begin", email = "ludovick.begin@gmail.com" }, + { name = "Marc-Andre Vigneault", email = "marc-andre.vigneault.2@ulaval.ca" }, + { name = "Daniel Cote", email = "dccote@cervo.ulaval.ca" } +] +license = "MIT" +license-files = ["LICENSE"] +requires-python = ">=3.9" +dynamic = ["version"] +dependencies = [ + "numpy>=2.0.0", + "matplotlib", + "tqdm", + "psutil", + "configobj", + "Pygments", + "siphash24; python_version < '3.13'", + "pyopencl", + "vtk>=9.4", + "mayavi-dev", + "pyqt5", +] + +[project.optional-dependencies] +dev = [ + "mockito", + "coverage", + "pytest", + "ruff", +] + +[tool.setuptools] +packages = ["pytissueoptics"] + +[tool.setuptools.package-data] +"pytissueoptics" = ["rayscattering/opencl/src/*.c", "**/*.obj", "examples/*.py"] + +[tool.setuptools_scm] +version_scheme = "guess-next-dev" +local_scheme = "node-and-date" + +[tool.pytest.ini_options] +testpaths = ["pytissueoptics"] +python_files = ["test*.py"] + +[tool.ruff] +line-length = 120 +target-version = "py39" + +[tool.ruff.lint] +select = ["ALL"] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 79206d20..00000000 --- a/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -testpaths = pytissueoptics -python_files = test*.py diff --git a/pytissueoptics/__init__.py b/pytissueoptics/__init__.py index 47a54a43..93cba814 100644 --- a/pytissueoptics/__init__.py +++ b/pytissueoptics/__init__.py @@ -1,5 +1,5 @@ from .scene import * from .rayscattering import * +from importlib.metadata import version - -__version__ = "2.0.0b1" +__version__ = version("pytissueoptics") diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9c558e35..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -. diff --git a/setup.py b/setup.py deleted file mode 100644 index 1903f43c..00000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -import setuptools - -""" -To distribute: -============= -rm dist/*; python setup.py sdist bdist_wheel; python -m twine upload dist/* -""" - -with open('README.md', 'r') as readme_file: - long_description = readme_file.read() - -setuptools.setup( - name="pytissueoptics", - version="2.0.0b1", - url="https://github.com/DCC-Lab/PyTissueOptics", - author=["Ludovick Begin", "Marc-Andre Vigneault", "Daniel Cote"], - author_email=["ludovick.begin@gmail.com", "marc-andre.vigneault.2@ulaval.ca", "dccote@cervo.ulaval.ca"], - description="Python module for 3D Monte Carlo Simulation of Light Propagation", - long_description=long_description, - long_description_content_type='text/markdown', - license='MIT', - keywords='tissue, optics, monte carlo, light propagation, simulation, scattering, ray tracing, 3D', - packages=setuptools.find_packages(), - install_requires=[ - 'numpy', - 'matplotlib', - 'tqdm', - 'mockito', - 'psutil', - 'configobj', - 'Pygments', - 'siphash24; python_version < "3.13"', - 'pyopencl', - 'traitsui', - 'vtk>=9.4', - 'mayavi-dev', - 'pyqt5', - ], - python_requires='>=3.9', - package_data={'pytissueoptics': ['rayscattering/opencl/src/*.c', '**/*.obj', 'examples/*.py']}, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Science/Research', - 'Intended Audience :: Education', - 'Topic :: Scientific/Engineering :: Physics', - 'Topic :: Scientific/Engineering :: Visualization', - 'Topic :: Education', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Operating System :: OS Independent' - ], -)