pybooru icon indicating copy to clipboard operation
pybooru copied to clipboard

Improved testing and update readme / docs

Open Nachtalb opened this issue 4 years ago • 4 comments

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 use python setup.py install/develop because it tries to import requests which it would install 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 a Pipfile. 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

Nachtalb avatar Feb 27 '20 01:02 Nachtalb

@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 avatar Feb 27 '20 02:02 Nachtalb

@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.

LuqueDaniel avatar Feb 27 '20 09:02 LuqueDaniel

AppVeyor and Travis settings fixed.

LuqueDaniel avatar Feb 27 '20 13:02 LuqueDaniel

I didn't know zest.releaser I really like the idea. Thanks!

LuqueDaniel avatar Feb 27 '20 13:02 LuqueDaniel