Skip to main content

Stoplight

Lint and Test PyPI PyPI - Python Versions PyPI - Downloads License

stoplight is a tool that enables educators to easily control push access to GitHub Classroom assignment repositories.

Please note that, as of now, stoplight only supports at most 100 student repositories per GitHub Classroom assignment.

Installation

Python 3.10 required. pipx recommended.

pipx install pystoplight

Usage

Authentication

Requires a GitHub personal access token.

Once created, place in your .stoplightrc file, which you can store either in the directory where you execute stoplight or in your home directory.

token = "<TOKEN>"

Or, you can pass it in as the value of the --token option.

stoplight red --token <TOKEN>

Commands

stoplight status

To check the permissions of all student repositories for a GitHub Classroom assignment, use stoplight status.

$ stoplight status --org stoplight-demo --assignment-title assignment
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ write      │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

Note that repositories whose names end with starter or solution or that are the assignment title are excluded.

You can also specify the organization and assignment title in your .stoplightrc.

token = "<TOKEN>"
org = "stoplight-demo"
assignment_title = "assignment"
$ stoplight status
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ write      │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

One way to use the .stoplightrc is to store it in a directory that you use to store starter and solution files for a GitHub Classroom assignment. Then, you can use stoplight from that directory to control the push access to that GitHub Classroom assignment. A .stoplightrc in the directory from which stoplight is executed will be given priority over a .stoplightrc in your home directory.

stoplight red

To disable push access for all students to their GitHub Classroom assignment repositories, use stoplight red.

$ stoplight red
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ read       │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

Notice that you cannot update the permissions of students who have admin access to their GitHub Classroom assignment repository. So, if you want to use stoplight, leave the following box unchecked when creating your GitHub Classroom assignment.

Setting

stoplight green

To enable push access for students to their GitHub Classroom assignment repositories, use stoplight green [STUDENTS]....

$ stoplight green Michionlion
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                     assignment                      
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                   ┃ User        ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion │ Michionlion │ write      │
└────────────────────────┴─────────────┴────────────┘

You can also use the --all option to enable push access for all students.

$ stoplight red
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ read       │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘
$ stoplight green --all
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ write      │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

For additional information, use stoplight --help.

Metadata

Release files for pystoplight 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pystoplight 1.0.0
File Size Uploaded
pystoplight-1.0.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pystoplight 1.0.0
File Interpreter ABI Platform
pystoplight-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / pystoplight-1.0.0.tar.gz

Download URL pystoplight-1.0.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f2ef371459f46d45c9294d25926b713e2d7454b64c2470f0fa76e258396601a5
BLAKE2b-256 checksum
How to use checksums
520566593562704a1d064fc6ed970d6f158467a6fe9ad6474b9910a5a5c4a5f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1028-azure

Release files / pystoplight-1.0.0-py3-none-any.whl

Download URL pystoplight-1.0.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ffcaab84b5da570f783c360424c44c6ae8143e9a242217abb10d65d74f3539c
BLAKE2b-256 checksum
How to use checksums
a0f92d0f7f7fd5cbd68a4505a1e732588d0e79a47805d23190951f219109f9ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1028-azure

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page