Skip to main content

Sets a standard header in all source files

Project description

setup_headers

Sets a standard header in all source files.

Traverses a project directory tree finding all files matching a sequence of extensions (e.g. py,cfg,yml), and replaces any comments on the beginning of the file by a set of lines from a header file, preceded by a comment marker.

The substitution does not apply to "hashbangs" markers (anything started by #!)

Installation

pip install jfaleiro.setup_headers

Configuration

Change your setup.py to reflect something like this:

...
from setup_headers import LicenseHeaderCommand
...
setup(
    ...
    cmdclass={
        'license_headers': LicenseHeaderCommand,
    },
    ...
)

Add your preferences to setup.cfg:

[license_headers]
header-file = HEADER
extensions = py,cfg,yml

Create a file mathing the name on header_file that you want to be inserted on the beginning of all files that match *.[extensions] - something like:

     my_awesome_project - Does something awesome

     Copyright (C) 2019 Joe Doe.

     This program is not free. You should pay lots of money to use it.
     Contact me for my paypal account.

     You should have received a copy of My Proprietary License
     along with this program.  If not, see <http://joe.doe/licenses/>.

Use

Just issue the command you have previously configured:

python setup.py license_headers

And that should be it.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

jfaleiro.setup_headers-0.0.1-py3-none-any.whl (16.9 kB view hashes)

Uploaded Python 3

Supported by

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