pybooru
pybooru copied to clipboard
Improved testing and update readme / docs
This PR basically introduces a new way of writing tests. Instead of a single file at the project root, we use pythons unittest
lib (in this case unittest2
because we want the same support for py2.7 and py3.6).
Additionally, I fixed a view things with the setup.py
and the documentation.
-
setup.py
should not import anything from the project itself because it leads to errors like not being able to usepython setup.py install/develop
because it tries to importrequests
which it wouldinstall
with either of the said commands. - We are missing requirements. ~The
sphinx
requirements to build the documentation were nowhere to be found.~ Just saw there is aPipfile
. Thus, I added an extra (docs
) which installs the required packages for us. - For development, we should install
unittests2
so we can run the tests. - I updated the documentation with the new and simpler installation method and extended it with additional info about usage of the documentation itself.
Your intent of importing the version from your package was probably so that you won't forget to update the version string somewhere without noticing. For that, I wholeheartedly recommend zest.releaser
https://pypi.org/project/zest.releaser/. This package makes life as a developer easy by removing the whole hassle of releasing stuff.
Before you release a package you can run longtest
to check if the readme and changelog markup is correct and then you run fullrelease
which does the whole release pipeline.
- Prerelease, changes like updating version strings, changelog release date
- Release, uploading the package to PyPI etc
- Postrelease, setting the version and changelog back to a development state
@LuqueDaniel Do you know how to fix the travis / appveyor stuff. One problem is that pylint returns exit code 30 which by both systems count as fail. And then the differences between the OSX and Linux machines on travis.
@Nachtalb First of all thank you very much for your contribution. A few weeks ago I added pylint as a linter, but I still have to configure it so that it isn't so strict. Sorry for the inconvenience.
AppVeyor and Travis settings fixed.
I didn't know zest.releaser I really like the idea. Thanks!