SConsider
SConsider is a SCons extension to provide a recursive target detection and dependency handling mechanism.
Instead of manually tracking locations of dependent projects and files, SConsider will scan your directory tree for *.sconsider
files and interpret the setting for building up the package and it’s targets during a later phase.
To reference a target from another package, you can simply reference it like SomePackage.TargetA
.
Install the development version into your virtualenv
Please check the packaging information to learn more about this topic.
Running tests
I recommend using tox to execute the tests as it properly sets up the right environment.
To see a list of available test environment to execute, list them using tox -l
and either
-
run the default environment(s)
tox
-
run a specific environment
tox -e some-env
Create a source/wheel package
The packaging guide will show you how to deploy a package and a short guide on wheels will explain you what wheels are.
Creating a wheel package is also handled by tox and the corresponding environment is wheel
.
It will create the wheel package and if you additionally want to get a source tarball, you can add sdist
as argument to tox like: tox -e wheel sdist
(Test-) Upload to pypi
A specific tox environment upload
exists in tox.ini which can be used to either test upload the package or to finally upload it to pypi.
More on this can be found in this thread and in the python packaging docu.
In order to run this environment, a ~/.pypirc
containing at least the following sections must exist and you need to register on both sites:
[distutils]
index-servers =
pypi
testpypi
[pypi]
#recommended to leave default
#repository:https://pypi.org/pypi
username:MyPypiUserName
password:MyPypiPass
[testpypi]
repository:https://test.pypi.org/legacy/
username:MyTestpypiUserName
password:MyTestpypiPass
Issue the following command to test the package, testpypi
is the default upload location:
tox -e upload
or use the following to finally upload it to pypi:
PYPI_REPO_NAME=pypi tox -e upload
To use a different pypi rc
file, use PYPIRC_LOCATION=/path/to/pypirc
prefix to the previous commands.