Skip to content

2.1.0 Added human_name, refactored setuppy + more

Compare
Choose a tag to compare
@Someguy123 Someguy123 released this 04 Nov 05:43
· 62 commits to master since this release

This release is the official 2.1.0 release (as published to PyPi).

Melded commits from develop branch

Once we merged develop into master, two small fix commits were melded into this 2.1.0 commit, to ensure
the published PyPi 2.1.0 release matches this Git release.

  • fix all on dynamically loaded functions

  • forgot to include extras/tests.txt in dev.txt

New features:

  • Added new function human_name to helpers.common which humanises a function/class name

  • Converted setuppy.py into a python module folder at setuppy/

  • Added new distutils extras:

    • extras/setuppy.txt to cover all setuppy optional requirements
    • extras/docs.txt contains requirements for building the Sphinx documentation
    • extras/dev.txt is a meta-extra which includes all extra requirements for development via full, docs and tests
  • Created privex.helpers.setuppy.bump

    • Most notably, this module contains a function bump_version which uses the package semver to bump a version number.
      The version number is extracted from a python package file configured in settings.VERSION_FILE and after it's updated,
      the file containing the version is automatically updated with the new version number.
  • Created privex.helpers.setuppy.commands which contains setup.py / distutils command classes

    • BumpCommand is a command class which allows you to bump the version of a python package, including updating the file containing the version,
      simply by running a command such as ./setup.py bump --minor

    • ExtrasCommand is a command class which helps with managing your package's extra_require by offering these features:

      • With no arguments, ./setup.py extras would output a list of all requirements listed for each extra in your extras_require
      • With the --save=somefile.txt argument, the requirements can be outputted into a file
      • With the --install argument, the requirements will be installed with pip using the python version which is running setup.py
      • With the --extra=myextra argument, only requirements for that individual extra will be listed/saved/installed
  • Added unit tests for human_name in tests/test_general.py

  • Created tests/test_net.py for network related unit tests

General changes / improvements:

  • Added __all__ to some modules, to reduce un-necessary objects being imported when you do wildcard imports such as from privex.helpers import *

  • Moved EXTRAS_FOLDER into helpers.settings for consistency and easier changing

  • Moved the various requirements.txt / extras related functions from setuppy.py into helpers.setuppy.common

  • Moved network related tests from test_general.py into the new test_net.py

  • The setup.py used for privex-helpers itself now has the commands bump and extras available, which uses the
    new command classes from privex.helpers.setuppy.commands

  • The file privex/helpers/__init__.py now imports privex.loghelper inside of a try/except block, so if for some strange reason
    privex-loghelper isn't installed or is broken, then it will fallback to standard logging.getLogger instead of just breaking

  • Fixed various issues with PyDoc blocks in several files, such as cache.KeyManager and crypto.RedisCache

  • Travis-CI now uses pip install -U '.[dev]' instead of installing the requirements file docs/requirements.txt and package

  • ReadTheDocs now uses pip install -U '.[dev]' instead of installing the requirements file docs/requirements.txt

  • Possibly other small fixes / changes

Documentation related:

  • Listed some of the new setuppy functionality in the overview in README.md

  • Updated the docs/requirements.txt file to include all important requirements

  • Updated the module.rst autosummary template to include attributes (if possible)

  • Updated the class.rst autosummary template so inherited attributes / methods are ignored (generated unit test class docs were often really spammy)

  • Added detailed documentation for the privex.helpers.setuppy module

  • Added an autosummary block for privex.helpers.settings so that it can correctly show the settings in the navigation

  • Fixed up several module/class rst files with :noindex: and other minor fixes to reduce the amount of warnings when building the docs

  • Re-organised the navigation tree for some modules to make it easier to use