Open michaelosthege opened 2 years ago
Currently there are no tests at all for this package. While this is something that we are aware of, right now all we want is a check whether it installs correctly. I don't think we need any additional requirements for this.
An empty requirements file could still guide future contributions into the typical structure. Or you could copy the flake8 step from this commit which should give you a basic safeguard against typos and syntax errors.
At the very least you should add a test_import.py
file with a pytest test that asserts successful import of your package.
It may sound trivial, but empirically most of my test suites are born from a simple import test.
Gotcha.
Alternatively, I just read it's also possible to put it in setup.cfg
Example: https://github.com/pyscaffold/pyscaffold/blob/master/setup.cfg#L62 Documentation: https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
Yeah, I fear there are plenty more ways how it could be done.
In my experience the requirements.txt
(or environment.yml
if you need dependencies from conda) are most popular.
I guess that's because it's handy to do something like pip install -r requirements.txt
when the deps are in a separate file.
For other configs (pytest, coverage, pylint, black, flake8, mypy) there are .pyproject.toml
(e.g. in PyMC) or MANIFEST.in
(e.g. in Aesara) and setup.cfg
probably falls into the same category.
I'm not familiar with this project, but @schmoelder asked me to help with setting up CI and this is something that you could prepare in advance to make a CI action easier to set up:
It will be good to have dependencies as
requirements.txt
files, so they can be installed in the CI action. Therequirements-dev.txt
should include any dependencies needed for development, but not for using the package. Typically these are things likepytest
. For documentation I like the structure with a docs-specificrequirements-dev.txt
that is installed as part of the readthedocs workflow.The following line helps to avoid duplicating this information in
setup.py
: https://github.com/JuBiotech/calibr8/blob/master/setup.py#L72