Skip to content

Conversation

@ninjinkun
Copy link
Contributor

@ninjinkun ninjinkun commented Jun 18, 2025

Summary

This PR migrates the Launchable CLI development environment from pipenv to uv, a modern Python package and project manager. This change brings significant performance improvements and simplifies the development workflow.

🚀 Key Benefits

Performance Improvements

  • 10-100x faster dependency resolution and installation
  • Dramatically reduced CI/CD build times
  • Faster local development environment setup

Simplified Python Version Management

  • Automatic Python installation: uv automatically downloads and manages the specified Python version
  • No more Python version matrix testing: Since uv ensures consistent Python versions across environments, we can simplify CI to test only Python 3.13
  • Better developer experience: Developers no longer need to manually install the correct Python version

Modern Tooling

  • Unified tool: Python version management + dependency management + virtual environments
  • Standards compliance: Full PEP 621 and modern Python packaging standards support
  • Better caching: Improved dependency caching in CI environments

📋 Changes Made

Configuration Updates

  • pyproject.toml: Added complete project metadata and dependencies
  • setup.cfg: Simplified by removing duplicate dependency definitions
  • Python requirement: Updated from 3.6+ to 3.13+ for modern Python features
  • Removed files: Pipfile and Pipfile.lock (replaced by pyproject.toml and uv.lock)

Development Workflow

  • Task runner: Integrated poethepoet for development tasks
  • Simplified commands: All development tasks now use uv run poe <task>
  • Available tasks:
    • uv run poe test - Run tests
    • uv run poe lint - Code linting
    • uv run poe type - Type checking
    • uv run poe format - Code formatting
    • uv run poe build - Build packages

CI/CD Improvements

  • Simplified workflows: Updated GitHub Actions to use uv
  • Single Python version: Removed multi-version matrix testing (Python 3.13 only)
  • Faster builds: Leverages uv's superior caching and performance
  • Tool installation: Uses uv tool install for global CLI installation

Documentation Updates

  • README.md: Updated with uv installation and usage instructions
  • CLAUDE.md: Updated development commands and workflow
  • Version upgrade guide: Added comprehensive guide for future Python version updates

🔧 Migration Guide for Developers

Before (pipenv)

pip install pipenv
pipenv install --dev
pipenv shell
pipenv run test

After (uv)

# Install uv (one-time setup)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Setup and use
uv sync --dev
uv run poe test

Key Advantages for Users

  1. No Python version management: uv automatically downloads Python 3.13 if not available
  2. Faster setup: Dependencies install 10-100x faster than with pipenv
  3. Consistent environments: Guaranteed reproducible builds across all platforms
  4. Single tool: No need to manage multiple tools for Python versions, virtual environments, and dependencies

🧪 Testing

  • ✅ All existing tests pass
  • ✅ CI/CD workflows updated and tested
  • ✅ Local development workflow verified
  • ✅ Cross-platform compatibility (Ubuntu, Windows, macOS)
  • ✅ Dependency resolution verified (lxml 5.4.0 with Python 3.13 wheels)

🔄 Breaking Changes

For End Users

  • None: The launchable CLI functionality remains identical
  • Installation: Still available via pip install launchable from PyPI

For Contributors

  • Python requirement: Now requires Python 3.13+ (was 3.6+)
  • Development setup: Must use uv instead of pipenv
  • Task commands: Use uv run poe <task> instead of pipenv run <task>

📚 Additional Notes

Rename Github Actions files

  • python-publish.yml to publish.yml
  • python-package.yml to test.yml

Dependency Changes

  • Version constraints relaxed: Removed strict upper bounds on dependencies (click, autopep8, mypy, types-pkg_resources) to allow automatic updates to latest compatible versions
  • Modern package metadata: Migrated from deprecated pkg_resources to standard library importlib.metadata for version detection
  • lxml: Updated to 5.4.0 with Python 3.13 wheel support (eliminates need for system dependencies)
  • poethepoet: Added for task management
  • Removed packages: Several build-time dependencies no longer needed

Python Version Management

The .python-version file serves as the authoritative source for the Python version requirement. When updating Python versions in the future, update these files:

  1. .python-version
  2. pyproject.toml (requires-python)
  3. setup.cfg (python_requires)
  4. GitHub Actions workflows
  5. Documentation files

This migration positions the Launchable CLI for modern Python development practices while maintaining full backward compatibility for end users.

@ninjinkun ninjinkun force-pushed the introduce-uv branch 2 times, most recently from d75009a to c6146d7 Compare June 18, 2025 07:54
@ninjinkun ninjinkun force-pushed the introduce-uv branch 3 times, most recently from 5e0ccb5 to b2eda83 Compare June 19, 2025 01:54
@ninjinkun ninjinkun added the Smart Tests CLI The next gen CLI label Jun 19, 2025
@ninjinkun ninjinkun marked this pull request as ready for review June 19, 2025 02:17
@ninjinkun ninjinkun requested review from Konboi and Copilot June 19, 2025 02:52

This comment was marked as outdated.

@ninjinkun ninjinkun removed the request for review from Konboi June 19, 2025 02:57
@ninjinkun ninjinkun requested a review from Konboi June 19, 2025 03:39
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: uv publish --token ${{ secrets.PYPI_API_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should define a new token as different name.
We should keep to be able to publish v1 and v2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. I'm going to update the token when I create a new package in PyPI.

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-latest]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to set multiple Python versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With uv, we only need to support a specified version. In this case, that's 3.13 in .python-version.

## Prerequisite

- \>= Python 3.6
- \>= Python 3.13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we support from 3.6? Is it ok??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Konboi
Copy link
Contributor

Konboi commented Jun 19, 2025

Q: Will we continue to use this repo?

If that’s the case, we’d want to be able to maintain both v1 and v2.
We’ll probably need to set up separate tag and PR workflows for the v1 and v2 releases, right?

@ninjinkun ninjinkun requested a review from Copilot June 26, 2025 01:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the development environment from pipenv to uv, updating project configuration, CLI commands, and CI workflows to leverage the performance and modern features of uv.

  • Migrates dependency and Python version management from pipenv to uv
  • Updates configuration files (pyproject.toml, setup.cfg, .python-version) and documentation accordingly
  • Revamps CI/CD workflows by removing pipenv steps and introducing uv-based actions

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
setup.cfg Updated python_requires and removed duplicate dependency definitions
pyproject.toml Added complete project metadata and uv configuration
launchable/version.py Replaced pkg_resources usage with importlib.metadata
README.md Updated installation and task commands from pipenv to uv
Pipfile Removed as part of the migration
.python-version Updated Python version from 3.6.15 to 3.13
.github/workflows/test.yml Revamped CI workflow using uv for dependency installing, testing, linting, etc.
.github/workflows/python-package.yml Removed obsolete pipenv-based workflow
.github/workflows/publish.yml Simplified publish workflow using uv publish command
.github/workflows/e2e.yml Updated workflow with new branch condition and uv integration for end-to-end tests

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ninjinkun
Copy link
Contributor Author

Q: Will we continue to use this repo?

If that’s the case, we’d want to be able to maintain both v1 and v2.

Yes, we will continue to use this repo.

We’ll probably need to set up separate tag and PR workflows for the v1 and v2 releases, right?

That's right. In v1 branch, it keeps using the existing PR workflow. We should prepare another tag and PR workflow for v2.

@ninjinkun ninjinkun requested a review from Konboi June 26, 2025 01:27
set -x
launchable verify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't change the command name??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change the command name in another PR.

pyproject.toml Outdated
"click>=8.1",
"requests>=2.25",
"urllib3>=1.26",
"junitparser>=2.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in main branch, we updated the junitparser to v4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm going to backport the main branch. Thank you for noticing!

dynamic = ["version"]

[project.urls]
Homepage = "https://launchableinc.com/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you change the information in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it in another PR as well as the command name. Thanks for reminding me.

Copy link
Contributor

@Konboi Konboi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment, but I'll approve not to block your task

with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: uv publish --token ${{ secrets.PYPI_API_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be fine, but just to prevent anything from accidentally running on this branch and getting uploaded to PyPI,
could you temporarily change the variable name to something safer?

ninjinkun and others added 2 commits June 27, 2025 09:32
Change PYPI_API_TOKEN to SMART_TESTS_PYPI_API_TOKEN to prevent
accidental publishing during development on feature branches.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link

@ninjinkun ninjinkun merged commit 8939b16 into smart-tests Jun 27, 2025
4 checks passed
@ninjinkun ninjinkun deleted the introduce-uv branch June 27, 2025 00:57
@github-actions github-actions bot mentioned this pull request Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Smart Tests CLI The next gen CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants