GithubHelp home page GithubHelp logo

Comments (2)

merwok avatar merwok commented on July 30, 2024

Side-by-side with the code only works if you are not using an src directory to isolate your package source (see https://blog.ganssle.io/articles/2019/08/test-as-installed.html)

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.

from python-packaging.

kousu avatar kousu commented on July 30, 2024

Side-by-side with the code only works if you are not using an src directory to isolate your package source (see https://blog.ganssle.io/articles/2019/08/test-as-installed.html)

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

echo include tests/*.py >> MANIFEST.in

or using https://pypi.org/project/setuptools-scm/. But that seems weird to me; the manifest seems fine.

from python-packaging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.