Skip to main content
https://travis-ci.org/farzadghanei/distutilazy.svg?branch=master https://ci.appveyor.com/api/projects/status/q4lhncemrsnpftgv?svg=true

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

An entry point script is also provided to call commands directly, currently only the clean commands are exposed via the script.

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.3, 3.4, 3.5, 3.6, PyPy 2.6 and PyPy3.5 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 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.

Entry Point Script

The distutilazy script provides a direct access to the commands. call it with -h or –help to see available commands. For example this command runs the clean_all command (provided by distutilazy package) directly, even without a setup.py or setup.cfg.

$ distutilazy clean_all

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.

The MIT License (MIT)

Copyright (c) 2014-2018 Farzad Ghanei

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for distutilazy 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for distutilazy 0.5.1
File Size Uploaded
distutilazy-0.5.1.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for distutilazy 0.5.1
File Interpreter ABI Platform
distutilazy-0.5.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 28.1 kB

Release files / distutilazy-0.5.1.tar.gz

Download URL distutilazy-0.5.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c62452c8a4c5dbac0bb0f74c08c6da450bf9e85a8881590e7610af6b798bfad9
BLAKE2b-256 checksum
How to use checksums
acdda4a0cec23a6875f7c880270527a6cf09314eb5895c26424f7bb000e7f0ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15

Release files / distutilazy-0.5.1-py2.py3-none-any.whl

Download URL distutilazy-0.5.1-py2.py3-none-any.whl
Size 13.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
471f50dc9276393161f9c4b906649895ebba0c4bff50783f54a8a02af54d21c9
BLAKE2b-256 checksum
How to use checksums
7a3638f6663d476f6f15bd15e1ae608c3653cfa0be63950f556037ca485cd5b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page