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

Auto-generation of setup.py #25

Merged
merged 4 commits into from
Jul 7, 2020
Merged

Conversation

m-alisafaee
Copy link
Contributor

Generate setup.py on merges to master that change poetry.lock or pyproject.toml.

Fixes #15

@m-alisafaee m-alisafaee force-pushed the 15-github-action-for-setup.py branch from 8f1f1d2 to 045b853 Compare June 26, 2020 14:01
git config --local user.name "RenkuBot"
git add setup.py
git commit -m 'chore: automatically generate setup.py' || true
git push origin ${{ github.head_ref }}
Copy link
Member

Choose a reason for hiding this comment

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

I believe this isn't going to work because of branch protection - the best you can do is push to a branch and automatically open a PR that could be automatically approved and merged. To do that, you need a token that is not the default token injected by github actions because those by design cannot trigger new actions.

Copy link
Member

Choose a reason for hiding this comment

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

You can look at this workflow in the main renku repo as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created a token with under my account which will create PRs with my name. Do we have a RenkuBot token to use here?

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better for the action to run on each branch and update the setup.py as a commit on that branch, if needed. Similar to how we create the Pipfile.lock in renku-python

Copy link
Member

Choose a reason for hiding this comment

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

Right, so run on the PR branch rather than master? That would certainly be easier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought of it in the beginning but I don't like to have a commit added to my PR/branches automatically.

Copy link
Member

@rokroskar rokroskar left a comment

Choose a reason for hiding this comment

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

I would remove the explicit ref (since it's a default) but if it needs to be there for some reason feel free to leave it in.

@m-alisafaee m-alisafaee merged commit 1733734 into master Jul 7, 2020
@m-alisafaee m-alisafaee deleted the 15-github-action-for-setup.py branch July 7, 2020 14:29
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.

Add a GitHub action to generate setup.py
3 participants