Skip to content

Commit

Permalink
Switch to pyproject.toml install
Browse files Browse the repository at this point in the history
  • Loading branch information
sequoiap committed Oct 24, 2023
1 parent 27dfe52 commit 792119f
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 222 deletions.
5 changes: 0 additions & 5 deletions .isort.cfg

This file was deleted.

6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

install:
pip install -r requirements.txt --upgrade
pip install -e .
pip install -e .[dev]
pip install pre-commit
pre-commit install

book:
cd docs && make html

lint:
flake8

Expand Down
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ SiPANN is distributed on PyPI_ and can be installed with ``pip``:
pip install SiPANN
Note that some dependencies (``gdspy``) require building from source. You'll
need the Python3 dev package:

.. code:: console
sudo apt-get install python3-dev
Developmental Build
#####################

Expand Down
145 changes: 145 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
[project]
name = "SiPANN"
version = "2.0.0"
description = "Artifical Neural Networks for use with Silicon Photonics"
readme = "README.rst"
requires-python = ">=3.8, <3.11"
license = {file = "LICENSE"}
keywords = [
"photonics",
"simulation",
"circuits",
"science",
"engineering",
"physics",
"artificial",
"neural",
"networks",
"silicon",
"coupling",
]

# This should be your name or the name of the organization who originally
# authored the project, and a valid email address corresponding to the name
# listed.
authors = [
{name = "Easton Potokar", email = "[email protected]" },
{name = "Alec Hammond"},
{name = "R Scott Collings"},
{name = "BYU CamachoLab", email = "[email protected]"}
]

# This should be your name or the names of the organization who currently
# maintains the project, and a valid email address corresponding to the name
# listed.
maintainers = [
{name = "Sequoia Ploeg", email = "[email protected]"},
{name = "BYU CamachoLab", email = "[email protected]"}
]

classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: OS Independent",
]

dependencies = [
"tensorflow ~= 2.9.1",
"gdspy >= 1.5.2",
"scikit-rf",
"numba",
"numpy>=1.22",
"simphony",
"nlopt==2.7.1",
"matplotlib",
"tables",
"tqdm",
]

[project.optional-dependencies]
dev = [
"pre-commit",
"matplotlib",
"bump2version~=1.0.0",
"flake8",
"pytest",
"coverage",
"build",
"pytest",
]
# doc = [
# "sphinx-book-theme ~= 0.3.3",
# "jupyter-book ~= 0.13.2",
# "matplotlib",
# "numpydoc",
# ]
test = [
"pytest",
"coverage",
]

[project.urls]
"Homepage" = "https://sipann.readthedocs.io/en/latest/"
"Documentation" = "https://sipann.readthedocs.io/en/latest/"
"Source" = "https://github.com/BYUCamachoLab/SiPANN"
"Bug Reports" = "https://github.com/BYUCamachoLab/SiPANN/issues"
"Research Group" = "https://camacholab.byu.edu/"

[tool.setuptools]
include-package-data = true
package-data = {"SiPANN" = [
"COUPLER/*.npz",
"LR/*.pkl",
"ANN/TIGHT_ANGLE_GAP/*",
"ANN/TIGHT_ANGLE_STRAIGHT/*",
"ANN/TIGHT_ANGLE_BENT_RAND/*",
]}

[tool.setuptools.packages.find]
include = ["SiPANN"]
# exclude = ["contrib", "docs", "tests", "examples"]
namespaces = false

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--maxfail=2 -rf"
testpaths = ["tests"]
norecursedirs = ["LR", "COUPLER", "ANN"]
console_output_style = "progress"
filterwarnings = ["ignore::UserWarning", "ignore::DeprecationWarning"]

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88
known_third_party = ["simphony", "jax", "matplotlib", "numpy", "packaging", "tensorflow", "pytest", "scipy"]
known_first_party = ["SiPANN"]

[build-system]
requires = ["setuptools>=62.0.0", "wheel", "pip<=23.1.2"]
build-backend = "setuptools.build_meta"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py38 # py39 py310
[testenv]
commands = py.test SiPANN
deps = pytest
"""
10 changes: 0 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
[tool:pytest]
addopts = --maxfail=2 -rf
testpaths = tests
norecursedirs = LR COUPLER ANN
console_output_style = progress

filterwarnings =
ignore::UserWarning
ignore::DeprecationWarning

[flake8]
max-line-length = 88
max-complexity = 18
Expand Down
199 changes: 0 additions & 199 deletions setup.py

This file was deleted.

Loading

0 comments on commit 792119f

Please sign in to comment.