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

chore: migrate to starflow and Makefile #143

Merged
merged 22 commits into from
Jan 14, 2025
Merged

chore: migrate to starflow and Makefile #143

merged 22 commits into from
Jan 14, 2025

Conversation

lengau
Copy link
Collaborator

@lengau lengau commented Dec 12, 2024

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint && make test?

This will be easiest to review on a per-commit basis.

Fixes #146

CRAFT-3835

@lengau lengau force-pushed the work/starflow branch 2 times, most recently from 5cbd270 to f66691c Compare December 12, 2024 01:40
@lengau lengau force-pushed the work/starflow branch 3 times, most recently from f17298e to bb23dca Compare December 12, 2024 01:58
@lengau lengau changed the title Work/starflow chore: migrate workflows to starflow Dec 12, 2024
@lengau lengau requested review from tigarmo and upils December 12, 2024 02:04
@lengau lengau marked this pull request as ready for review December 12, 2024 02:05
@lengau lengau changed the title chore: migrate workflows to starflow chore: migrate to starflow and Makefile Dec 12, 2024
@lengau lengau requested a review from upils December 16, 2024 22:15
@tigarmo
Copy link
Collaborator

tigarmo commented Dec 18, 2024

When I run make lint twice, the second run fails with:

❯ make lint
ruff check  craft_archives tests
ruff format --diff  craft_archives tests
craft_archives/_version.py:15:25: Q000 [*] Single quotes found but double quotes preferred
   |
13 | version_tuple: VERSION_TUPLE
14 | 
15 | __version__ = version = '2.0.2.post18+g2ecb2d6.d20241218'
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q000
16 | __version_tuple__ = version_tuple = (2, 0, 2, 'g2ecb2d6.d20241218')
   |
   = help: Replace single quotes with double quotes

craft_archives/_version.py:16:47: Q000 [*] Single quotes found but double quotes preferred
   |
15 | __version__ = version = '2.0.2.post18+g2ecb2d6.d20241218'
16 | __version_tuple__ = version_tuple = (2, 0, 2, 'g2ecb2d6.d20241218')
   |                                               ^^^^^^^^^^^^^^^^^^^^ Q000
   |
   = help: Replace single quotes with double quotes

Found 2 errors.
[*] 2 fixable with the `--fix` option.
make: *** [common.mk:90: lint-ruff] Error 1

Didn't we configure ruff to ignore that autogenerated file at some point?

@lengau
Copy link
Collaborator Author

lengau commented Jan 6, 2025

@tigarmo we did, but it never got brought into craft-archives it seems. I've added it now.

@tigarmo
Copy link
Collaborator

tigarmo commented Jan 13, 2025

@lengau thanks. I think the ruff update broke linting
... here's another issue I'm having; if I run make test-fast (and probably other make commands), uv.lock gets modified:

❯ make test-fast
uv run pytest -m 'not slow'
Using CPython 3.10.12 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Installed 29 packages in 7ms
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.12, pytest-7.4.2, pluggy-1.5.0
rootdir: /home/tiago/Projects/craft/craft-archives
configfile: pyproject.toml
testpaths: tests
plugins: mock-3.11.1, check-2.2.1, cov-4.1.0
collected 221 items / 3 deselected / 218 selected                                                                                                                                           

(snip)
() ~/Projects/craft/craft-archives on  work/starflow [$!] 
❯ git status
On branch work/starflow
Your branch is up to date with 'origin/work/starflow'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   uv.lock

no changes added to commit (use "git add" and/or "git commit -a")
() ~/Projects/craft/craft-archives on  work/starflow [$!] 
❯ git diff
diff --git a/uv.lock b/uv.lock
index 191108f..f7d51c9 100644
--- a/uv.lock
+++ b/uv.lock
@@ -16,6 +16,7 @@ constraints = [
     { name = "markdown", specifier = ">=3.0" },
     { name = "markupsafe", specifier = ">=2.0" },
     { name = "oauthlib", specifier = ">=3.0.0" },
+    { name = "pluggy", specifier = ">=1.2.0" },
     { name = "protobuf", specifier = ">=5.0" },
     { name = "pynacl", specifier = ">=1.5" },
     { name = "pyparsing", specifier = ">=3.0.0" },
@@ -337,7 +338,7 @@ toml = [
 
 [[package]]
 name = "craft-archives"
-version = "2.0.2.post8+gcff4467.d20241212"
+version = "2.0.2.post19+g5fdbdfa.d20250113"
 source = { editable = "." }
 dependencies = [
     { name = "distro" },

do you know how we can avoid this modification? Should we use uv run --frozen instead? Or set UV_NO_SYNC more globally in common.mk? Seems like only a few commands should be allowed to touch the lockfile

@lengau
Copy link
Collaborator Author

lengau commented Jan 13, 2025

@tigarmo good catch! That's an oversight I've fixed upstream in canonical/starbase#322 and brought here. I also auto-formatted with the latest changes (which includes switching from yamllint to prettier).

@tigarmo
Copy link
Collaborator

tigarmo commented Jan 13, 2025

@lengau thanks for this! Once the checks finish I'll update the required ones & merge

@tigarmo tigarmo merged commit 6788c43 into main Jan 14, 2025
10 of 11 checks passed
@tigarmo tigarmo deleted the work/starflow branch January 14, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to starflow
3 participants