This Python CLI replaces build_release.sh
for building and uploading OSPC
conda packages. Instead of using environment variables to toggle the given
actions and packages, we now use subcommands for greater control. The CLI also
makes it easier to pin dependencies and build only one package at a time.
git clone https://github.com/open-source-economics/policybrain-builder
cd policybrain-builder
python setup.py install
To upload packages to anaconda.org, make sure
you have installed anaconda-client
and logged into
anaconda.org:
conda install anaconda-client
anaconda login
The login username you give for anaconda login
will be the user under which
the packages are uploaded on the anaconda.org, which
should be ospc
.
Alternatively if you prefer not to login to anaconda-client but still want to
upload packages to anaconda.org, you can use the OSPC_ANACONDA_TOKEN
environment variable as an authentication argument that is passed from
pb release
or pb upload
to the anaconda-client's upload command (as the
-t
argument to anaconda
).
The environment variable OSPC_ANACONDA_TOKEN
, if used at all, must be an
anaconda.org token valid for conda uploads and it may be the auth token string
itself (about 40 to 60 characters) or a path to a text file on local machine
that has the token as its only contents. Contact Matt Jensen
(matt.jensen@aei.org) for access to the ospc
user if you are uploading on
behalf of Open Source Policy Center.
To use the latest tag for each package and to use the token provided via
~/.ospc_anaconda_token
:
pb release
To use the latest tag for each package and to use the token provided via environment variable:
OSPC_ANACONDA_TOKEN="<token>" pb release
To use the latest tag for each package and to use the token provided via the command line:
pb release --token "<token>"
This is useful for local verification.
pb build
This command will clone and build the btax
package, while pinning btax
's
dependency for taxcalc
to 0.9.1 without downloading taxcalc
. This is useful
for local verification.
pb build --only-last taxcalc=0.9.1 btax
This command will clone and build all packages, but only for the specified Python version (in this case, 3.6).
pb build --python 3.6
Note that the default (that is, using no --python
option) implies
packages will be built for both Python 2.7 and Python 3.6.
See the full explanation in this comment.
ANACONDA_FORCE
: Force a package upload regardless of errors (use forrelease
andupload
)OSPC_ANACONDA_CHANNEL
: Additional channel to search for packages (use forbuild
andrelease
)OSPC_ANACONDA_LABEL
: Add packages to a specific label (use forrelease
andupload
)OSPC_ANACONDA_TOKEN
: Authentication token (use forrelease
andupload
)OSPC_PYTHONS
: Set Python versions for building packages (use forbuild
andrelease
)WORKSPACE
: Directory used for cloning, building, and uploading (use for all subcommands)
Check for your packages on anaconda.org. Note you
may want to use the "Edit label" link on the "Files" page for your package(s)
to change a label from dev
to main
if you like a package and want to final
release it.