From 29020e4202510814b9c06d598f6015da7cf2ecd0 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Tue, 30 Sep 2025 18:24:38 -0600 Subject: [PATCH 1/7] chore: use pure python not conda (#13) --- .devcontainer/devcontainer.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 015d616..c0a5c78 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Python 3", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm", + "image": "mcr.microsoft.com/devcontainers/python:3.12", "features": { "ghcr.io/devcontainers-extra/features/copier:7.0.15": { "version": "9.10.2" @@ -20,10 +20,6 @@ "ghcr.io/devcontainers-extra/features/isort:2.0.18": { "version": "6.0.1" }, - "ghcr.io/rocker-org/devcontainer-features/miniforge:2": { - "version": "latest", - "variant": "Miniforge3" - }, "ghcr.io/va-h/devcontainers-features/uv:1": { "version": "0.8.22" }, From 9f51e5fb2f896776834ebaadfdbad7e554ebdb81 Mon Sep 17 00:00:00 2001 From: Naty Clementi Date: Thu, 2 Apr 2026 17:50:11 -0400 Subject: [PATCH 2/7] chore(dep): Update hatch devcontainer (#24) --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c0a5c78..b9a7a79 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,7 @@ "version": "9.10.2" }, "ghcr.io/devcontainers-extra/features/hatch:2.0.18": { - "version": "1.14.2" + "version": "1.16.5" }, "ghcr.io/devcontainers-extra/features/pre-commit:2.0.18": { "version": "4.3.0" From 175cb7ae08d1220186ccc4ab7a0dac002152caa8 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 15:50:54 -0600 Subject: [PATCH 3/7] docs: add ncclementi as a contributor for code, review, and bug (#25) * docs: update README.md [skip ci] * docs: create .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 28 ++++++++++++++++++++++++++++ README.md | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..f3a5dc0 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,28 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "commitType": "docs", + "commitConvention": "angular", + "contributors": [ + { + "login": "ncclementi", + "name": "Naty Clementi", + "avatar_url": "https://avatars.githubusercontent.com/u/7526622?v=4", + "profile": "https://github.com/ncclementi", + "contributions": [ + "code", + "review", + "bug" + ] + } + ], + "contributorsPerLine": 7, + "skipCi": true, + "repoType": "github", + "repoHost": "https://github.com", + "projectName": "pyopensci-workshop-create-python-package", + "projectOwner": "pyOpenSci" +} diff --git a/README.md b/README.md index 1bb1662..1889b0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # pyOpenSci: Create a Python Package Workshop Repository + +[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) + This repository supports pyOpenSci workshops focused on Python packaging. @@ -22,3 +25,25 @@ To use the copier template, follow the [tutorial here](https://www.pyopensci.org The command to run the copier template is: `copier copy gh:pyopensci/pyos-package-template .` + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + +
Naty Clementi
Naty Clementi

💻 👀 🐛
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file From 15ca17906b15491f09104909466809f6abb35297 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Mon, 6 Apr 2026 10:18:42 -0600 Subject: [PATCH 4/7] Fix: Updates to dev container and readme (#26) * deps: update dev container * fix: readme file --- .devcontainer/devcontainer.json | 10 +++++----- README.md | 16 +++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b9a7a79..09f2df2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,22 +6,22 @@ "image": "mcr.microsoft.com/devcontainers/python:3.12", "features": { "ghcr.io/devcontainers-extra/features/copier:7.0.15": { - "version": "9.10.2" + "version": "9.14.1" }, "ghcr.io/devcontainers-extra/features/hatch:2.0.18": { "version": "1.16.5" }, "ghcr.io/devcontainers-extra/features/pre-commit:2.0.18": { - "version": "4.3.0" + "version": "4.5.1" }, "ghcr.io/devcontainers-extra/features/black:2.0.18": { - "version": "25.9.0" + "version": "26.3.1" }, "ghcr.io/devcontainers-extra/features/isort:2.0.18": { - "version": "6.0.1" + "version": "8.0.1" }, "ghcr.io/va-h/devcontainers-features/uv:1": { - "version": "0.8.22" + "version": "0.11.3" }, }, "extensions": [ diff --git a/README.md b/README.md index 1889b0c..58b1115 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,20 @@ This repository supports pyOpenSci workshops focused on Python packaging. ## Getting started -Before the workshop, be sure that you read the setup instructions that you recieved in an email. +Before the workshop, be sure that you read the setup instructions that you received in an email. -You will need a GitHub and a testPyPI account to follow along. +You will need a GitHub and a testPyPI account to follow along. ## GitHub Codespaces -We have GitHub Codespaces configured for this workshop. To be successful during -the workshop, we suggest that you fork and open a codespace prior to attending -the workshop to ensure the enviornment loads properly. The initial codespace build can take up to 15 minutes. +We have GitHub Codespaces configured for this workshop. To use this repository and the dev container associated with it in a workshop, instructor your learners to create a new repository +as a template using this repo. + +Open a codespace prior to attending +the workshop to ensure the environment loads properly. The initial codespace build can take up to 15 minutes. The link above provides you with instructions -one how to do this and how to setup the accounts you need for the workshop. +on how to do this and how to setup the accounts you need for the workshop. ## Creating your package @@ -46,4 +48,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! From ff8075fdf34da1e84596af638061db9448b27701 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Mon, 6 Apr 2026 10:25:11 -0600 Subject: [PATCH 5/7] feat: animated gif for user as template Added an image to the README for visual guidance. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 58b1115..f3daf2b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ You will need a GitHub and a testPyPI account to follow along. We have GitHub Codespaces configured for this workshop. To use this repository and the dev container associated with it in a workshop, instructor your learners to create a new repository as a template using this repo. +![use-template](https://github.com/user-attachments/assets/c4778b46-70dc-4d3e-86d5-b1bd50f8d183) + + Open a codespace prior to attending the workshop to ensure the environment loads properly. The initial codespace build can take up to 15 minutes. From 320a09a0753731407df665f205094789e231bdb5 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Mon, 6 Apr 2026 15:22:43 -0600 Subject: [PATCH 6/7] feat: add cheatsheet to readme (#27) * fix: readme file * feat: add cheatsheet --- README.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f3daf2b..9ecd21a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ as a template using this repo. ![use-template](https://github.com/user-attachments/assets/c4778b46-70dc-4d3e-86d5-b1bd50f8d183) - Open a codespace prior to attending the workshop to ensure the environment loads properly. The initial codespace build can take up to 15 minutes. @@ -31,6 +30,97 @@ The command to run the copier template is: `copier copy gh:pyopensci/pyos-package-template .` +## Cheat Sheet + +Below is a command cheat sheet that will help you keep track of all of hte various commands used in our tutorials. + +--- + +## Ship It: Command Cheat Sheet + +### Codespace setup (one-time) + +```console +# Shorten your terminal prompt +export PS1="$ " +``` + +```console +# Disable keyring when publishing to Py +export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring +``` + +### Create your package + +```bash +# Call the pyOpenSci template +copier copy gh:pyOpenSci/pyos-package-template . +``` + +### uv commands + +```bash +# Launch Python in your project environment +uv run python +# Add package dependency +uv add numpy +# Remove packagedependency +uv remove numpy +# Add a development dependency +uv add --dev pytest + +``` + +### Hatch environments + +```bash +# see all Hatch environments and scripts +hatch env show +# build + check your package with twine +hatch run build:check +# Run test suite with coverage (across Python versions) +hatch run test:run +# Build sphinx documentation +hatch run docs:build +# Serve sphinx docs locally with live reload +hatch run docs:serve +# Check docstrings & code style +hatch run style:check +# Format code with ruff +hatch run style:format +# Check dependencies for vulnerabilities +hatch run audit:check +``` + +### Build & publish + +```bash +# build sdist + wheel into dist/ using native hatch in your current environment +hatch build + +# Publish with hatch to test pypi (r = repository) +hatch publish -r test +``` + +### Install a package + +```bash +# Install from Test PyPI +uv pip install --index-url https://test.pypi.org/simple/ your-package-name +pip install -i https://test.pypi.org/simple/ your-package-name + +# Install from GitHub +pip install git+https://github.com/username/repo-name +``` + +### Run tests directly with pytest (vs hatch) + +```bash + # Run all tests in your active Python envt with pytest +pytest # Run tests using pytest with coverage +pytest --cov=pyospackage --cov-report=term-missing +``` + ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): From 05933554c5138d58344844a34b0552440b8cff27 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Tue, 7 Apr 2026 09:28:01 -0600 Subject: [PATCH 7/7] docs: a few typos Clarify comments in README for better understanding. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9ecd21a..89de810 100644 --- a/README.md +++ b/README.md @@ -46,14 +46,14 @@ export PS1="$ " ``` ```console -# Disable keyring when publishing to Py +# Disable keyring. You need to do this in codesppaces only when publishing to PyPI using Hatch. export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring ``` ### Create your package ```bash -# Call the pyOpenSci template +# Call the pyOpenSci package template copier copy gh:pyOpenSci/pyos-package-template . ``` @@ -64,7 +64,7 @@ copier copy gh:pyOpenSci/pyos-package-template . uv run python # Add package dependency uv add numpy -# Remove packagedependency +# Remove package dependency uv remove numpy # Add a development dependency uv add --dev pytest @@ -74,9 +74,9 @@ uv add --dev pytest ### Hatch environments ```bash -# see all Hatch environments and scripts +# View all Hatch environments and scripts hatch env show -# build + check your package with twine +# build your package; check your package distribution files using twine hatch run build:check # Run test suite with coverage (across Python versions) hatch run test:run