Skip to main content

Extra distutils commands

Project description

https://travis-ci.org/farzadghanei/distutilazy.svg?branch=master

Extra distutils commands, including:

  • clean_pyc: clean compiled python files

  • clean_jython_class: clean compiled .class files created by Jython

  • clean_all: using distutils.clean, clean_pyc and clean_jython_class to clean all temporary files

  • bdist_pyinstaller: convenient calls for PyInstaller with sane defaults

  • test: run unit tests

Installation

Use pip to install from PyPI:

$ pip install distutilazy

To install from the source, download the source and run

$ python setup.py install

There are no specific dependencies, distutilazy runs on Python 2.7+ (CPython 2.7, 3.2, 3.3, 3.4 and 3.5, PyPy 2.6 and PyPy3 2.4 are tested). Tests pass on Jython so it should be fine for Jython as well.

How

After installing distutilazy, add distutilazy.command package to the list of command packages in your setup.cfg file.

[global]
command_packages = distutilazy.command

That’s it. Now you may use new commands directly from your setup.py.

To run unit tests (using standard library unittest) in your project (by default runs tests/test*.py files from current path):

$ python setup.py test

To clean compiled python files:

$ python setup.py clean_pyc

To clean all temporary files (build artifacts, compiled files created by CPython or Jython, etc.):

$ python setup.py clean_all

Available commands are in distutilazy.command package, each command as a separate module.

To use custom command names for the same functionality, use command classes defined in distutilazy modules (each module might define more than a single command class).

The modules should be imported in setup.py, then desired classes might be assigned to command names using the cmdclass parameter.

import distutilazy.clean

setup(
    cmdclass: {
        'clean_pyc': distutilazy.clean.CleanPyc,
        'clean_jython': distutilazy.clean.CleanJythonClass,
        'clear': distutilazy.clean.CleanAll
    }
)

To extend (or customize) the behavior of the command classes define a class extending from these command classes, and use that custom class in cmdclass.

Development

Tests

If you have make available

$ make test

You can always use setup.py to run tests:

$ python setup.py test

License

Distutilazy is released under the terms of MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

distutilazy-0.4.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

distutilazy-0.4.0-py2.py3-none-any.whl (13.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file distutilazy-0.4.0.tar.gz.

File metadata

  • Download URL: distutilazy-0.4.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for distutilazy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2787086e39e4a0efa1c640a16a04e71a0b9fe049b0d6d815066bc4fe7c130581
MD5 a10e4ea6ac8d036aa76c535bc86fb2f8
BLAKE2b-256 1cac678dc6b29de3428670375de6cedeb4c5780684b563b12c659756c4ab3aab

See more details on using hashes here.

File details

Details for the file distutilazy-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for distutilazy-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b6798398dc215f365bdc2f043712036320ad756c4aa018da5229545afe11c9ab
MD5 f403e1f960a0640930d85755f5b782f2
BLAKE2b-256 e5b9378d5facd96ecc7612e96a171c8330a41df6f9aadc995414b884fd44a2a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page