You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Top-level tests is common. Depending on your build tool (setuptools or flit or poetry or other), you may need configuration to make sure that the tests are present in sdists, but not installed.
Now I'm veering off-topic, but I wish there wasn't a distinction between installed/not installed. It isn't necessary in Javascript or Scheme or lots of other languages. I've been thinking about it and I think the reason comes down to the rule that submodules locate themselves -- and relative imports -- by __name__, splitting on "."s instead of by __file__, splitting on "/"s or better yet following "..". Can you think of any other reason?
Depending on your build tool (setuptools or flit or poetry or other), you may need configuration to make sure that the tests are present in sdists, but not installed.
Just to spread this knowledge around since it's going to get buried, PyPA now seems to be advocating either
Activity
merwok commentedon Jul 9, 2020
Side-by-sidewith the code only works if you are not using ansrcdirectory to isolate your package source (see https://blog.ganssle.io/articles/2019/08/test-as-installed.html)Top-level
testsis common. Depending on your build tool (setuptools or flit or poetry or other), you may need configuration to make sure that the tests are present in sdists, but not installed.kousu commentedon Jul 12, 2020
Now I'm veering off-topic, but I wish there wasn't a distinction between installed/not installed. It isn't necessary in Javascript or Scheme or lots of other languages. I've been thinking about it and I think the reason comes down to the rule that submodules locate themselves -- and relative imports -- by
__name__, splitting on "."s instead of by__file__, splitting on "/"s or better yet following "..". Can you think of any other reason?Just to spread this knowledge around since it's going to get buried, PyPA now seems to be advocating either
or using https://pypi.org/project/setuptools-scm/. But that seems weird to me; the manifest seems fine.