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

Version 1 #31

Draft
wants to merge 70 commits into
base: main
Choose a base branch
from
Draft

Version 1 #31

wants to merge 70 commits into from

Conversation

patrick91
Copy link
Collaborator

@patrick91 patrick91 commented Jul 24, 2022

This PR changes the whole structure of autopub based on what we discusses in #30.

There's a new CLI (powered by typer and rich) that's going to be the frontend for the Autopub class. The CLI will only get input and display output, all the work is going to be done by the Autopub class.

This is an initial POC, I want to get some feedback on how it looks and especially how the plugin system works. I intentionally didn't spend too much time on it.

The PR implements only the check command, which you can test by doing poetry run autopub check.

For this command the ideas is that we can have plugins that can add additional validation and also perform actions when the validation fails or passes[1].

CleanShot 2022-12-02 at 19 13 12@2x

[1] this is what we do for Strawberry, we send a GitHub comment with the information about the release.

TODOs

  • Add support for frontmatter
    • Make it preferred format, and deprecate old one
    • Allow passing additional contributors to thank (sometimes people open an issue and spend a lot of effort on that, we should allow thanking them)
  • Add support for building (and allow plugins)
    • Support for poetry
    • Support for pdm
  • Add support for publishing
    • Support for poetry
    • Support for pdm
    • Run publish via plugin
  • Support for writing a changelog
  • Support for getting information about the PR from GitHub (via a plugin)
  • Support for creating the release (GitHub release, git tag, and so on)

Closes #30

autopub/__init__.py Outdated Show resolved Hide resolved
@@ -0,0 +1,67 @@
from pathlib import Path
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll move these classes into different files when we agree on the overall architecture :)

Comment on lines 26 to 38
@app.command()
def build():
print("building")


@app.command()
def publish():
"""
1. commit
2. release
3. push on pypi or similar
"""
print("publishing")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Feel free to ignore these, I added when I was testing typer out 😊

@justinmayer
Copy link
Collaborator

Nice work, Patrick! This seems like an excellent start to me, so I say continue along this path and see where it leads. Well done! 👏

@justinmayer
Copy link
Collaborator

Hey Patrick! Great to see you at PyCon Italia. Some folks at the DjangoCon EU sprints and I are working on improving Kagi, particularly as it relates to CI and release automation. There's already a pull request there that landed today to add support for PyPI’s new Trusted Publisher feature, and there has been discussion of migrating Kagi from Poetry to Hatchling + PDM-or-Hatch. A lot of these changes seem like a good fit as potential AutoPub plugins. 😊

So… I just thought I'd check in and see when you might be able to make some time to move this modularized AutoPub endeavor forward. What do you think?

@patrick91
Copy link
Collaborator Author

@justinmayer being realistic I won't have a lot of time in the next two weeks unfortunately :(

I also really need this but I'm struggling a bit to prioritise it, hopefully after the GitHub accelerator program I'll have time.

But if there's anyone willing to work on this, then I'd be happy to give the PR to them 😊

@patrick91
Copy link
Collaborator Author

@justinmayer I'm going to do a pair programming session with @bellini666 on this next week!

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.

Ideas/proposal for AutoPub 1.0
2 participants