Skip to main content

LSST Data Management SQuaRE code management tools

Project description

[![Build Status](https://travis-ci.org/lsst-sqre/sqre-codekit.svg?branch=master)](https://travis-ci.org/lsst-sqre/sqre-codekit)

# sqre-codekit

LSST DM SQuaRE misc. code management tools

## Installation

sqre-codekit runs on Python 3.6 or newer. You can install it with

```bash
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):

```bash
github-auth -u {{username}}
```

Or to generate a token with delete privileges:

```bash
github-auth -u {{username}} --delete-role
```

### `github-fork-org`

To clone all [github.com/lsst](https://github.com/lsst) repos into an GitHub
organization called `{{username}}-shadow`:

```bash
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:

```bash
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

```bash
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](http://pytest.org/latest/):

```bash
python setup.py test
```

or

```bash
pytest tests
```


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

sqre-codekit-7.3.2.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

sqre_codekit-7.3.2-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file sqre-codekit-7.3.2.tar.gz.

File metadata

File hashes

Hashes for sqre-codekit-7.3.2.tar.gz
Algorithm Hash digest
SHA256 dc4ec2e9e6c4797a8e50487d4023b1b12797dda0b7e1db9469dc739b75dd2826
MD5 71a091f371d2082eeb65920698156da8
BLAKE2b-256 3a6665d1c3ea609ac9df3d692a9d687929812724b834debbf1bd96796a8c8b42

See more details on using hashes here.

File details

Details for the file sqre_codekit-7.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sqre_codekit-7.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d5c8181f569ada5d17c4eacc65af4b15b8f0b0ba5bf3f680baebeca9c7de9a71
MD5 6675eb201b305dc8af4278a55d76a5b9
BLAKE2b-256 dc2d925cf7587d299943cef7c2f5db2e74f404f5e8626fbf3058381a59f973b1

See more details on using hashes here.

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