LSST Data Management SQuaRE code management tools
Project description
sqre-codekit
LSST DM SQuaRE misc. code management tools
Installation
sqre-codekit runs on Python 3.6 or newer. You can install it with
pip install sqre-codekit
Available commands
github-auth
: Generate a GitHub authentication token.github-decimate-org
: Delete repos and/or teams from a GitHub organization.github-fork-org
: Fork repositories from one GitHub organization to another.github-get-ratelimit
: Display the current github ReST API request ratelimit.github-list-repos
: List repositories on Github using various criteria.github-mv-repos-to-team
: Move repo(s) from one team to another.github-tag-release
: Tag git repositories, in a GitHub org, that correspond to the products in a published eups distrib tag.github-tag-teams
: Tag the head of the default branch of all repositories in a GitHub org which belong to the specified team(s).
Use the --help
flag with any command to learn more.
Example usage
github-auth
To generate a personal user token (you will be prompted for your password):
github-auth -u {{username}}
Or to generate a token with delete privileges:
github-auth -u {{username}} --delete-role
github-fork-org
To clone all github.com/lsst repos into an GitHub
organization called {{username}}-shadow
:
github-fork-org \
--dry-run \
--debug \
--src-org 'lsst' \
--dst-org '{{username}}-shadow' \
--token "$GITHUB_TOKEN" \
--team 'DM Auxilliaries' \
--team 'DM Externals' \
--team 'Data Management' \
--copy-teams
You'll need to create this shadow organization in advance. Working in a shadow organization is useful for testing.
github-decimate-org
If you want to take a recent fork, you will need to delete the existing shadow repos first:
github-decimate-org \
--dry-run \
--debug \
--org 'example' \
--token "$GITHUB_TOKEN" \
--delete-repos \
--delete-repos-limit 3 \
--delete-teams \
--delete-teams-limit 3
That requires a token with delete privileges.
To get more debugging information, set your DM_SQUARE_DEBUG
variable before
running any command, or use the -d
debug flag on the command line.
github-tag-release
XXX
github-tag-teams
XXX
github-get-ratelimit
XXX
Development
To develop codekit, create a Python virtual environment, and
git clone https://github.com/lsst-sqre/sqre-codekit.git
cd sqre-codekit
virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
python setup.py develop
Note that all scripts (in codekit/cli
) are installed using setuptools
entry_points
. See setup.py
.
tests
Unit tests can be run with pytest:
python setup.py test
or
pytest tests
Project details
Release history Release notifications | RSS feed
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 sqre-codekit-7.5.0.tar.gz
.
File metadata
- Download URL: sqre-codekit-7.5.0.tar.gz
- Upload date:
- Size: 42.2 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.46.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aebb28af76d367c6d313f5f234e789ee68f2d8107ff1b15636bb9ebbfcb52dc3 |
|
MD5 | 6226cf3f43b87a8231ca9fb79a3cec0c |
|
BLAKE2b-256 | 5b2a2e354e14d257c93b74dcd66f726e029da12ae01a765e4fa1f9711b998a96 |
File details
Details for the file sqre_codekit-7.5.0-py3-none-any.whl
.
File metadata
- Download URL: sqre_codekit-7.5.0-py3-none-any.whl
- Upload date:
- Size: 39.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.46.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aa92589a2a8052dc0a3f41850da6317d9d0ef09400d61316e60ed5d696cdac4 |
|
MD5 | 6ce084d2104f7da5c8be4bfbc8d8db17 |
|
BLAKE2b-256 | c7168a1b6efc2fcbfdd478e3551f74088bda49130e1ea996945843addb7a0611 |