A little module that helps loading SCons tools installed via pip
Project description
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
Built Distribution
File details
Details for the file scons-tool-loader-0.2.0.tar.gz
.
File metadata
- Download URL: scons-tool-loader-0.2.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0dc13e9b57054e1a48f864a0955ed399270722c013531dde1af925205aa5216 |
|
MD5 | f162317958b6ba50b5ad35afaaca694a |
|
BLAKE2b-256 | 55e4e2467a0163de64f82af65b92acc996ec9d5d3f98228c31b6446938ce345e |
File details
Details for the file scons_tool_loader-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: scons_tool_loader-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5fa397c19f26129d7ab700f07f8378bd51d2bb75d6187fe45732b000fd8cbbe |
|
MD5 | b383215ab6730e6c83a500ac3c6ba90c |
|
BLAKE2b-256 | a20a98df98b558467d7c69c4d0c4a7f1a0fcf66d63cec47765050cfa52cd6756 |