Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scripts to run under uv correctly #174

Merged
merged 4 commits into from
Jan 10, 2025
Merged

Fix scripts to run under uv correctly #174

merged 4 commits into from
Jan 10, 2025

Conversation

rhysyngsun
Copy link
Collaborator

What are the relevant tickets?

N/A

Description (What does it do?)

The scripts weren't working for me with the usages in the readme and I initially missed the gotcha at the top. I initially implemented things this way when the tooling we used made this easier. Under uv isn't not exactly clear if/how we can get the ergonomics to work well so I just moved everything into a scripts/ folder for simpler usage.

How can this be tested?

Run some commands to be sure they still work:

  • uv run scripts/changelog.py list -a common
  • uv run scripts/version.py show --app common
  • uv run scripts/release.py create --help - can't actually run a release so this just verifies the command loads correctly

@jkachel jkachel self-assigned this Jan 9, 2025
Copy link
Contributor

@jkachel jkachel left a comment

Choose a reason for hiding this comment

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

Functionality looks fine to me.

I had issues running commands via uv locally - it turned out I needed to be in the src/ folder to run them. Once i did that, everything worked OK to the extent that I could test it. This was on both macOS and Ubuntu. Can the docs note this? (FWIW, the Docker env worked as expected, and worked running the scripts from within the src/ folder too.)

@rhysyngsun
Copy link
Collaborator Author

You shouldn't need to be in src/ to run them, what error were you getting?

@rhysyngsun
Copy link
Collaborator Author

Looks like I need to fix up historical changelogs, not sure why those never got consumed and why previous PRs never failed them.

@jkachel
Copy link
Contributor

jkachel commented Jan 9, 2025

You shouldn't need to be in src/ to run them, what error were you getting?

If I'm not in src/ it doesn't see any apps to work with (but only locally). Example:

$ uv run -p 3.11 scripts/version.py show --help
Usage: version.py show [OPTIONS]

  Show current version of your project.

Options:
  -v, --verbose                 Control log level. -vv for debug level.
  -f, --fetch / -n, --no-fetch  Sync tags from remote origin.
  --environ                     Print version state for use with shell
                                scripts: eval $(bumpver show --environ)
  -a, --app []                  [required]
  --help                        Show this message and exit.

From src/ I get apps listed.

@rhysyngsun rhysyngsun merged commit 5d3260f into main Jan 10, 2025
9 checks passed
@rhysyngsun rhysyngsun deleted the nl/fix-scripts branch January 10, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants