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

updates the Makefile to ensure consistent installations of black and click. #1668

Closed
wants to merge 8 commits into from

Conversation

Akshat2Jain
Copy link
Member

Description

This PR updates the Makefile to ensure consistent installations of black and click. Currently, the Makefile installs the latest versions, while the CI process installs specific versions mentioned in the versions.cfg file. This PR aligns the installations in the Makefile with the versions specified in the versions.cfg file.

Changes Made

  • Modified the Makefile to install black and click with the versions mentioned in versions.cfg.
    OR
  • Upgraded the installations of black and click to the latest versions mentioned in versions.cfg.

Reason for the Changes

  • Ensures consistency between local development and the CI environment.
  • Aligns installations with the versions specified in versions.cfg.
    OR
  • Benefits from the latest features and bug fixes available in the upgraded versions.

This is pr is realated to #1655

@mister-roboto
Copy link

@Akshat2Jain thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@netlify
Copy link

netlify bot commented Jul 7, 2023

Deploy Preview for plone-restapi canceled.

Name Link
🔨 Latest commit c1a0883
🔍 Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/64b131688cc6fa0008db25b6

@Akshat2Jain
Copy link
Member Author

@wesleybl Plz review

news/1668.bugfix Outdated
@@ -0,0 +1 @@
updates the Makefile to ensure consistent installations of black and click. @Akshat2Jain
Copy link
Member

@wesleybl wesleybl Jul 7, 2023

Choose a reason for hiding this comment

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

Use the issue number in the file name.

Ops, we don't have an issue.

Use the internal extension.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry but I'm not familiar with that term . what exactly you meant by 'internal extension.'

Copy link
Member

Choose a reason for hiding this comment

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

In the same way that we have the .bugfix, we also have the .internal. The options are here:

https://github.com/plone/plone.restapi/blob/master/pyproject.toml

We use .internal, when the change is interest only to the package developers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

there is no issue , so should I name the file as 1668.internal

Makefile Outdated
@@ -44,7 +44,7 @@ update: ## Update Make and Buildout
bin/buildout: bin/pip
bin/pip install --upgrade pip
bin/pip install -r requirements-5.2.txt
bin/pip install black || true
bin/pip install --upgrade click==$(awk '/^click =/{print $NF}' versions.cfg) black==$(awk '/^black =/{print $NF}' versions.cfg) || true
Copy link
Member

Choose a reason for hiding this comment

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

Looks like black wasn't installed:

$ make black
if [ -f "bin/black" ]; then bin/black src/ ; fi

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@Akshat2Jain Akshat2Jain Jul 8, 2023

Choose a reason for hiding this comment

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

Looks like black wasn't installed:

$ make black
if [ -f "bin/black" ]; then bin/black src/ ; fi

but it shows black version 23.3.0, so it means black is installed
@wesleybl

Copy link
Member

@wesleybl wesleybl Jul 10, 2023

Choose a reason for hiding this comment

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

It must have been installed before you update the code in the Makefile. You can run a make clean to remove the previous installation. Then if you run make again you will see that black is not installed. The error occurs:

bin/pip install --upgrade click== black== || true
ERROR: Could not find a version that satisfies the requirement click== (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.5.1, 0.6, 0.7, 1.0, 1.1, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 5.0, 5.1, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7.dev0, 6.7, 7.0, 7.1, 7.1.1, 7.1.2, 8.0.0a1, 8.0.0rc1, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.1.4)
ERROR: No matching distribution found for click==

@Akshat2Jain
Copy link
Member Author

Hey @wesleybl, I have made the changes, now it installed the correct version from the version.cfg

$ ./bin/black --version
black, 22.3.0 (compiled: yes)

@Akshat2Jain
Copy link
Member Author

Hey @stevepiercy, I have changed the file name to 1668.internal

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

A grammar fix, and then I approve the news item. I have not tested the Makefile.

@@ -0,0 +1 @@
updates the Makefile to ensure consistent installations of black and click. @Akshat2Jain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
updates the Makefile to ensure consistent installations of black and click. @Akshat2Jain
Updated the Makefile to ensure consistent installations of black and click. @Akshat2Jain

@stevepiercy
Copy link
Contributor

There's a failing test, and I have no idea why it fails: https://github.com/plone/plone.restapi/actions/runs/5529801801/jobs/10088359044?pr=1668#step:10:205

@stevepiercy
Copy link
Contributor

And now the failing test passes. ¯\_(ツ)_/¯

Copy link
Member

@wesleybl wesleybl left a comment

Choose a reason for hiding this comment

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

LGTM

@wesleybl wesleybl requested review from tisto and davisagli July 12, 2023 13:28
@tisto
Copy link
Member

tisto commented Jul 12, 2023

LGTM. Though, I am afraid we currently do not use versions.cfg as far as I can see. I'd suggest including it everywhere and cleaning it up. Or we just use base.cfg to fetch the black versions (seems like the easier way to go for now).

@wesleybl
Copy link
Member

@tisto you are sure. versions.cfg is not used by buildout. So I'm +1 for revomering versions.cfg.

Looking closer, the buildout doesn't install black. Only the Makefile and the CI. So I think it would be better to create a constraints.txt, and use it in these places. So the install would just be something like:

pip install -c constraints.txt black

This simplifies the installation avoiding complications like:

run: pip install click==$(awk '/^click =/{print $NF}' versions.cfg) black==$(awk '/^black =/{print $NF}' versions.cfg)

Copy link
Member

@wesleybl wesleybl left a comment

Choose a reason for hiding this comment

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

See: #1668 (comment)

Maybe it's better to create another PR.

@wesleybl
Copy link
Member

Closed in favor of #1671.

@wesleybl wesleybl closed this Jul 14, 2023
@Akshat2Jain Akshat2Jain deleted the update-makefile branch July 14, 2023 16:12
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.

5 participants