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

Switch tooling to uv + dev-cmd. #117

Merged
merged 4 commits into from
Jan 5, 2025
Merged

Switch tooling to uv + dev-cmd. #117

merged 4 commits into from
Jan 5, 2025

Conversation

jsirois
Copy link
Contributor

@jsirois jsirois commented Jan 4, 2025

No description provided.

@jsirois
Copy link
Contributor Author

jsirois commented Jan 5, 2025

Reviewers, this is mainly FYI. Although uv doesn't really have a build system and dev-cmd is very basic, it's worth noting the combo gets the job done very quickly with little fuss. The main changes of note:

  • pyproject.toml: The new [tool.dev-cmd] sections.
  • .github/**: Minimal changes to switch from nox to uv.
  • CONTRIBUTING.md & RELEASE.md: Again, minimal changes to switch from nox to uv.

- name: Setup Nox
if: matrix.docker-platform == ''
run: pip install nox
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Astral doesn't release for Windows arm yet; thus the special case here.

- name: Setup x86_64 Python for Prism
if: matrix.os == 'windows-arm64'
run: |
UV_PYTHON_VERSION=cpython-3.12.8-windows-x86_64-none
Copy link
Contributor Author

@jsirois jsirois Jan 5, 2025

Choose a reason for hiding this comment

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

Likewise, PBS has no Windows ARM release; so this gets uv using x86-64 PBS / Windows PRISM emulation. This was done similarly, but with more fuss, in noxfile.py.

ci = [["check-fmt", "check-lint", "type-check", "test"]]
run = [["doc", "create-zipapp"], "run-zipapp"]

package = [["doc", "create-zipapp"], ["package-thin-scie", "package-fat-scie"]]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The nested lists run in parallel. So doc & create-zipapp run in parallel, then, when both are complete, package-thin-scie & package-fat-scie run in parallel. The serial / parallel / serial / ... nesting switches can be carried on as deeply nested as desired.

from typing import Any


def main() -> Any:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The noxfile had alot of complicated glue. This is all that remains.

@@ -37,7 +37,7 @@ def _maybe_gather_git_state() -> str | None:
if git_info.returncode == 0:
return git_info.stdout.strip()

logger.warning(f"Failed to gather git state for provenance.")
logger.warning("Failed to gather git state for provenance.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes in this file and the next 5 are all due to the switch from black / isort /autoflake to ruff.

Copy link
Collaborator

@benjyw benjyw left a comment

Choose a reason for hiding this comment

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

Nice!

@jsirois jsirois merged commit 6aca17b into a-scie:main Jan 5, 2025
10 checks passed
@jsirois jsirois deleted the uv/dev-cmd branch January 5, 2025 18:21
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.

2 participants