phoebe-project / phoebe2

PHOEBE - Eclipsing Binary Star Modeling Software
http://phoebe-project.org
GNU General Public License v3.0
76 stars 28 forks source link

Import from within source tree overly restrictive #819

Closed aprsa closed 5 months ago

aprsa commented 5 months ago

In order to avoid same-name module conflicts with the system module (such as io.py), phoebe shouldn't be imported from its own source tree. The original test eliminated the entire package tree, including all auxiliary directories, which is overly restrictive and it prevented pytest from running when phoebe was installed with pip -e. This PR fixes that by blocking imports from the root directory and from the root/phoebe tree (the actual sources). Closes #806.

aprsa commented 5 months ago

Before we merge in though, it just occurred to me that this is in init; should we avoid defining phoebe.cwd and phoebe.rootdir, or at least prepend a ''?

kecnry commented 5 months ago

We really should just use __all__.... but we can do that later repo-wide