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-2020 by Paweł 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.

Source Distribution

scons-tool-loader-0.2.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

scons_tool_loader-0.2.0-py3-none-any.whl (6.4 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