New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

distutils-extra-python

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distutils-extra-python

Add support for i18n, documentation and icons to distutils

  • 2.39.2
  • PyPI
  • Socket score

Maintainers
1

distutils-extra

distutils-extra can be used with python's distutils or the enhanced setuptools.

  1. DISTUTILS

To make use of the distutils extenstions, you have to import the corresponding methods at the beginning of your setup.py:

.. code:: python

from DistUtilsExtra.command import *

Furthermore you have to map the methods to the extended ones:

.. code:: python

cmdclass = { "build" : build_extra.build_extra, "build_i18n" : build_i18n.build_i18n }

If you have replaced the default build command by build_extra and defined the other commands e.g. build_i18n, the sub commands e.g. will be called automatically. There is no need to enable them in the setup.cfg anymore (This was require in a previous version). Disabling imported commands in the setup.cfg is still possible:

.. code:: bash

[build] i18n=False

See the setup.cfg.example for a more complex layout.

Currently there are the following extensions available:

.. code:: bash

build_extra: initiates the extensions build_i18n: provides gettext integration build_icons: installs icons build_help: installs a docbook based documentation

  1. SETUPTOOLS

Just enable the corresponding build target in the setup.cfg:

.. code:: bash

[build] i18n=True help=True icons=True

No further imports or modifications are required.

I hope that this code could help you to make your live easier,

  1. DistUtilsExtra.auto

This module provides a setup() method for distutils and DistUtilsExtra which infers as many setup() arguments as possible. The idea is that your setup.py only needs to have the metadata and some tweaks for unusual files/paths, in a "convention over configuration" paradigm.

This currently supports:

.. code:: bash

- Python modules (./*.py, only in root directory)
- Python packages (all directories with __init__.py)
- GtkBuilder (*.ui)
- Qt4 user interfaces (*.ui)
- D-Bus (*.conf and *.service)
- PolicyKit (*.policy.in)
- Desktop files (*.desktop.in)
- KDE4 notifications (*.notifyrc.in)
- scripts (all in bin/, and ./<projectname>
- Auxiliary data files (in data/*)
- automatic po/POTFILES.in (with all source files which contain _())
- automatic MANIFEST (everything except swap and backup files, *.pyc, and revision control)
- manpages (*.[0-9])
- files which should go into /etc (./etc/*, copied verbatim)
- determining "requires" from import statements in source code
- determining "provides" from shipped packages and modules

If you follow above conventions, then you don't need any po/POTFILES.in, ./setup.cfg or ./MANIFEST.in, and just need the project metadata (name, author, license, etc.) in ./setup.py.


Author: Henry Fuheng Wu, Sebastian Heinlein, Martin Pitt

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc