Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Eliminates manual version file editing and reduces release process from 5 steps to 1. Follows implementation pattern from gallantlab/autoflatten.

Changes

Version Management

  • Version numbers now automatically derived from git tags via setuptools-scm
  • cortex/version.py imports from auto-generated _version.py with fallback for dev environments
  • Removed manual version parsing logic from setup.py
  • Development versions auto-increment as X.Y.Z.devN between releases

Release Workflow

  • Replaced tag-based workflow with release event trigger
  • Builds artifacts in isolated job, publishes to both PyPI and TestPyPI
  • Uses trusted publishing (OIDC) instead of API tokens
  • Added workflow_dispatch for manual TestPyPI testing
  • fetch-depth: 0 ensures setuptools-scm can access full git history

Release Process (see updated RELEASE.md)

# Before: Edit version.py, commit, tag, push, create release, revert version
# After: Create GitHub release with version tag (e.g., v1.3.0)

Prerequisites for Deployment

Repository admins must configure PyPI/TestPyPI environments with trusted publishing before workflow can publish packages.

Original prompt

This section details on the original issue you should resolve

<issue_title>Simplify release workflow</issue_title>
<issue_description>The current release workflow requires too many steps.
Follow what I implemented in https://github.com/gallantlab/autoflatten:

  1. Use setuptools-scm to automatically derive version numbers from git tags
  2. Set up a workflow to release to pypi and testpypi upon new github releases.

</issue_description>

<agent_instructions>Make sure to check how I implemented this in https://github.com/gallantlab/autoflatten. I will need to enable environments in pypi/testpypi. But you can assume that they will be available. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits December 15, 2025 16:20
Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Copilot AI changed the title [WIP] Simplify release workflow with setuptools-scm Automate version management with setuptools-scm and simplify release workflow Dec 15, 2025
Copilot AI requested a review from mvdoc December 15, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify release workflow

2 participants