Skip to content

Conversation

tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented Apr 19, 2022

Package Structure

restructured requirements setup:

requirements.txt
requirements/
    core.txt
    plotly.txt
    dev.txt

core.txt contains the core packages.
plotly.txt contains the packages needed to run plotly (core + plotly imports)
dev.txt contains the packages needed to run the tests (core + plotly + testing imports)

Note: the old import structure didnt work with this because it would try to import plotly and dash any time tidy3d was imported. So now, to import plotly stuff, need to do

from tidy3d.plugins.plotly import SimulationPlotly

Packaging

setup.py imports the install_requires from requirements.txt, which only contains common.txt.

setup.py also imports the contents of plotly.txt and adds these as an extra_requires.

This means when someone is pip installing tidy3d, they can do

pip install tidy3d (basic packages)
pip install "tidy3d[plotly]" (basic packages + plotly).

and if local installation, this command looks like
pip install -e ".[plotly]"

if you want to install the dev requirements, for testing, etc. just add
pip install -r requirements/dev.txt

@tylerflex tylerflex linked an issue Apr 19, 2022 that may be closed by this pull request
@tylerflex tylerflex merged commit 469edc0 into develop Apr 19, 2022
@tylerflex tylerflex deleted the tyler/requirements branch April 19, 2022 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional dash dependencies for headless installs
2 participants