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

feat(cli): add craft-application scaffolding #4456

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

mr-cal
Copy link
Collaborator

@mr-cal mr-cal commented Nov 28, 2023

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint?
  • Have you successfully run pytest tests/unit?

Adds craft-application scaffolding to snapcraft. This includes migrating to the Project model, adding an Application class, and CLI handling.

All commands are unimplemented, raise a ClassicFallback error, and execute the existing snapcraft code.

This has the same scope and intent as canonical/rockcraft#353.

This is based on @lengau's work in #4449, which includes this work and more (such as the implementation of lifecycle commands).

(CRAFT-2238)

@mr-cal mr-cal marked this pull request as draft November 28, 2023 22:12
@mr-cal mr-cal closed this Nov 29, 2023
@mr-cal mr-cal reopened this Nov 29, 2023
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
@mr-cal mr-cal marked this pull request as ready for review November 29, 2023 15:32
@mr-cal mr-cal changed the title [DRAFT] feat(cli): add craft-application scaffolding feat(cli): add craft-application scaffolding Nov 29, 2023
@mr-cal
Copy link
Collaborator Author

mr-cal commented Nov 29, 2023

Appveyor test failure looks like a network connectivity issue, but I can't re-run the test.

@mr-cal mr-cal requested review from tigarmo and lengau November 29, 2023 15:59
Copy link
Contributor

@lengau lengau left a comment

Choose a reason for hiding this comment

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

Looks good!

issues: Optional[UniqueStrList]
source_code: Optional[UniqueStrList]
website: Optional[UniqueStrList]
contact: Optional[models.UniqueStrList]
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we can use craft-application's UniqueStrList here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice, I switched to this in a few places. Can you check it? I'm not sure if the cast calls are the right approach

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do them with casts or just by calling the constructor (the constraint types are subclasses of their actual types). I don't think it makes much difference in code speed.

snapcraft/services/package.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
snapcraft/application.py Outdated Show resolved Hide resolved
snapcraft/commands/unimplemented.py Outdated Show resolved Hide resolved
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
@mr-cal mr-cal requested a review from lengau November 29, 2023 21:55
@mr-cal
Copy link
Collaborator Author

mr-cal commented Nov 30, 2023

Merging despite the Appveyor failure (it passed for the branch but not the PR) and I can't re-run it. As far as I can tell, the test passed but failed when uploading an artifact.

This is going into a feature branch, so I'm not too worried. If the Appveyor test continues to be flaky, I'll look into it more.

@mr-cal mr-cal merged commit b0258c1 into feature/craft-application Nov 30, 2023
8 checks passed
@mr-cal mr-cal deleted the CRAFT-2238-2 branch November 30, 2023 17:45
syu-w pushed a commit that referenced this pull request Jan 29, 2024
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
syu-w pushed a commit that referenced this pull request Jan 29, 2024
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
syu-w pushed a commit that referenced this pull request Jan 29, 2024
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
syu-w pushed a commit that referenced this pull request Jan 31, 2024
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
syu-w pushed a commit that referenced this pull request Feb 6, 2024
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
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.

3 participants