Skip to main content

A little module that helps loading SCons tools installed via pip

Project description

PyPi package version Documentation Status https://travis-ci.org/ptomulik/scons-tool-loader.svg?branch=master https://ci.appveyor.com/api/projects/status/github/ptomulik/scons-tool-loader?svg=true https://coveralls.io/repos/github/ptomulik/scons-tool-loader/badge.svg?branch=master Maintainability

A little python package that helps loading externally managed SCons tools.

Installation

To install module from pypi, type

pip install scons-tool-loader

or, if your project uses pipenv:

pipenv install --dev scons-tool-loader

Alternativelly, you may add this to your Pipfile

[dev-packages]
scons-tool-loader = "*"

This will install a namespaced package sconstool.loader in project’s virtual environment.

Usage examples

Using tools istalled into “standard” namespace

The “standard” namespace for pip-managed SCons tools is assumed to be sconstool namespace. In the following examples we assume that tools are installed as namespaced packages, under sconstool namespace. This is exactly how all the tools developed by the original author of the scons-tool-loader get installed.

For example, the following code

pip install scons-tool-clang

will install clang tool as sconstool.clang package. Once installed, it may be used in a SCons script by extending default toolpath and loading the tool to the construction environment

# SConstruct
import sconstool.loader
sconstool.loader.extend_toolpath()
env = Environment(tools=['default', 'sconstool.clang'])
env.Program('test.c')

If, for some reason, fully qualified package name can’t be used as the tool name, one may use “transparent” mode when extending toolpath

# SConstruct
import sconstool.loader
sconstool.loader.extend_toolpath(transparent=True)
env = Environment(tools=['default', 'clang'])
env.Program('test.c')

The above code will still load the sconstool.clang tool.

Using tools installed into “non-standard” namespaces

Suppose, some tools get installed into vendor namespace. For example, vendor.foo and vendor.bar are installed somewhere under sys.path. These tools may be made visible to scons by using namespace parameter, and scan.

# SConstruct
import sconstool.loader
sconstool.loader.extend_toolpath(namespace='vendor', scan=True)
env = Environment(tools=['default', 'sconstool.clang', 'vendor.foo', 'vendor.bar'])
# ...

More documentation

See the online documentation.

LICENSE

Copyright (c) 2018 by Pawel Tomulik <ptomulik@meil.pw.edu.pl>

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

Project details


Download files

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

Files for scons-tool-loader, version 0.1.10
Filename, size & hash File type Python version Upload date
scons_tool_loader-0.1.10-py2-none-any.whl (6.4 kB) View hashes Wheel py2
scons-tool-loader-0.1.10.tar.gz (5.1 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page