pypitools package

Submodules

pypitools.common module

This is common pypitools functionality

pypitools.common.check_by_twine() None[source]

check by twine

pypitools.common.check_if_needed() None[source]
pypitools.common.clean_after_if_needed() None[source]

Clean the git repo if needed

pypitools.common.clean_before_if_needed() None[source]

Clean the git repo if needed

pypitools.common.do_prerequisites(packages: List[str] | None = None) None[source]

Gather all prerequisites into a single folder

pypitools.common.package_it() None[source]

package our module

pypitools.common.register_by_setup() None[source]

register via setup.py register

pypitools.common.register_by_twine() None[source]

register via the twine method

pypitools.common.register_select() None[source]

Register via the method configured

pypitools.common.upload_by_gemfury() None[source]

upload to gemfury

The command line is the one recommended by gemfury at https://manage.fury.io/dashboard/[username]/push

pypitools.common.upload_by_setup() None[source]

upload by setup.py sdist upload

This method still works although it is legacy

see: python setup.py upload –help

pypitools.common.upload_by_twine() None[source]

upload by twine

pypitools.common.upload_select() None[source]

upload via the method configured

pypitools.configs module

Command line configurations for pypitools

class pypitools.configs.ConfigData[source]

Bases: Config

All parameters for the pypitools module

check_before_upload = True
clean_after = False
clean_before = False
gemfury_user = None
install_in_user_folder = False
module_name = 'pypitools'
pip = 'pip'
pip_quiet = True
python = 'python'
register_method = 2
requirements = 'requirements.txt'
setup_quiet = True
upload_method = 1
upload_sdist = True
upload_wheel = True
use_sudo = False
wheel_folder = 'wheel'
class pypitools.configs.ConfigOutput[source]

Bases: Config

Parameters to control output

suppress_warnings = False
verbose = False
class pypitools.configs.RegisterMethod(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Methods for registering

SETUP = 0
TWINE = 1
UPLOAD = 2
class pypitools.configs.UploadMethod(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Methods for uploading

GEMFURY = 2
SETUP = 0
TWINE = 1

pypitools.git_utils module

pypitools.git_utils.git_clean_full() None[source]

Clean the current git repo in a strict way

pypitools.main module

main entry point to the program

pypitools.main.bump() None[source]

This will: - check that all is committed - bump the version - run pydmt build - commit with a standard message - tag with a standard message - push - upload to pypi

pypitools.main.check() None[source]
pypitools.main.install_from_local() None[source]
pypitools.main.install_from_remote() None[source]
pypitools.main.main()[source]
pypitools.main.package() None[source]
pypitools.main.prerequisites() None[source]
pypitools.main.prerequisites_run() None[source]
pypitools.main.register() None[source]

This function registers your package in pypi.

when registering via twine(1) you need to: - full clean - build wheel using setup.py - twine register - full clean This method works, if you register twice it is ok. You just need to do it once…:)

when registering via setup.py you need to: - full clean - python setup.py register -r pypi - full clean registering the same package many times works. You just need to do it once…:)

References: - https://packaging.python.org/distributing/

TODO: - check if I’m already registered and don’t register if that is the case.

pypitools.main.upload() None[source]

This script uploads your module to where ever you configure it. It’s default is to upload to pypi but you can override by putting a pypi.cnf file in the root of your source tree.

It does the following: - clean - setup.py sdist - twine upload - clean again

Notes: - This script could be done via setuptools using the following: $ python3 setup.py sdist upload -r pypi –identity=”Mark Veltzer” –sign but this has bad security implications as it sends user and password plain text. - we use twine(1) to upload the package. On ubuntu twine(1) is from the ‘twine’ official ubuntu package.

References: - https://pypi.python.org/pypi/twine - https://python-packaging-user-guide.readthedocs.org/en/latest/index.html - http://peterdowns.com/posts/first-time-with-pypi.html

pypitools.name_utils module

pypitools.name_utils.get_package_filename() str[source]

Get the package filename

pypitools.name_utils.get_package_fullname() str[source]

Get the full name of the package

pypitools.name_utils.get_package_wheelname() str[source]

Get the package wheelname

pypitools.process_utils module

pypitools.process_utils.check_call_collect(args: List[str]) Tuple[str, str][source]

Run a process and check that it returns an OK return code Gather any output and return it to the caller. If the process returns an error then print the output and the errors. :param args:

pypitools.static module

version which can be consumed from within the module

pypitools.utils module

pypitools.utils.get_logger()[source]

Module contents