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

fix: Fix issues with docs, makim/make, release, and CI #182

Merged
merged 13 commits into from
Aug 31, 2023

Conversation

xmnlab
Copy link
Member

@xmnlab xmnlab commented Aug 29, 2023

Pull Request description

This is a big PR that aims to fix a bunch of issues:

  • Implement properly the makim targets, including tests and documentation tasks
  • Fix main CI workflow and the Release workflow
  • Fix the semantic-release configuration
  • Fix the some URLs in the GitHub ISSUES templates that was pointing to the repository
  • Fix some configurations in the pyprojet.toml
  • Add tests for the automation tools to CI
  • Update cookiecutter.json and the base profile respect to makim and make
  • Update some python pinning from 3.8 to 3.8.1

How to test these changes

  • ...

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • the tests generate log file(s) (path).
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more complexity.
  • New and old tests passed locally.

Additional information

Reviewer's checklist

Copy and paste this template for your review's note:

## Reviewer's Checklist

- [ ] I managed to reproduce the problem locally from the `main` branch
- [ ] I managed to test the new changes locally
- [ ] I confirm that the issues mentioned were fixed/resolved .

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks for the great work, @xmnlab! Some minor comments below. Also, should a user be allowed to user be allowed to use both makim and Make together? If not, then we should add a condition here -

def validation():
if USE_BLUE and USE_BLACK:
raise Exception(
"The libs Blue and Black were selected, but you need to choose "
"just one of them."
)

linter:
help: Run linter tools
run: |
pre-commit install
Copy link
Member

Choose a reason for hiding this comment

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

This isn't actually required, given that this file invoked pre-commit explicitly using pre-commit run --all-files --verbose. Having this is not a big issue too, does not take a lot of time to add pre-commit hooks as git hooks 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, the idea is to force the user to install the pre-commit hook locally ... maybe it is not the best approach, I am currently investigating some better approach for doing that.

for poetry I found this: https://pypi.org/project/poetry-pre-commit-plugin/
but it seems it is not mature yet (all its tests are not executed: https://github.com/vstrimaitis/poetry-pre-commit-plugin/blob/master/tests/test_plugin.py

maybe we could do it as a post-gen step .. so it could work for all the projects .. but we would need to create the environment first ... so not sure if it is a good idea or not

nodejs projects are very nice in this topic .. because when you install it for development, it automatically installs pre-commit hook.

so if it is not a problem, I would keep it for now, and in the meantime I will try to figure out a good approach that would works for all the build-systems

src/scicookie/{{cookiecutter.project_slug}}/Makefile Outdated Show resolved Hide resolved

.PHONY:lint
lint:
pre-commit install
Copy link
Member

Choose a reason for hiding this comment

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

This can be remove, but again, having it does not hurt a lot

Copy link
Member Author

Choose a reason for hiding this comment

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

as I mentioned before, I would keep this for now, until I come with a better solution to "force" the installation of pre-commit hooks from the beginning

@@ -35,7 +35,7 @@ classifiers = [
"Typing :: Typed",
Copy link
Member

Choose a reason for hiding this comment

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

Not related to this PR, but just noticed that these lines should be in a if cookiecutter.use_mypy == "yes" condition (in all the build backend pyproject.toml files).

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I see, I will open an issue for that. thanks!

Copy link
Collaborator

@Anavelyz Anavelyz left a comment

Choose a reason for hiding this comment

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

Great, A thousand thanks! 🚀

Leave some comments for the guide.

docs/guide.md Outdated Show resolved Hide resolved
docs/guide.md Outdated Show resolved Hide resolved
@@ -770,18 +770,18 @@ by selecting the option `None` (this is the default option).

## Automation Tools
Copy link
Collaborator

Choose a reason for hiding this comment

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

Include it in the structure, please

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, I am not following you here, could you give more details please?

Copy link
Collaborator

Choose a reason for hiding this comment

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

After that line:

- [Integration with DevOps tools](#integration-with-devops-tools)

should be:

- [Automation tools](#automation-tools)

Copy link
Member Author

Choose a reason for hiding this comment

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

oh got it, thank you for the explanation, I am going to add it now. thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

xmnlab and others added 3 commits August 30, 2023 15:20
Co-authored-by: Saransh Chopra <saransh0701@gmail.com>
Co-authored-by: Anavelyz Perez <42752529+Anavelyz@users.noreply.github.com>
@xmnlab
Copy link
Member Author

xmnlab commented Aug 30, 2023

Thanks for the great work, @xmnlab! Some minor comments below. Also, should a user be allowed to user be allowed to use both makim and Make together? If not, then we should add a condition here -

def validation():
if USE_BLUE and USE_BLACK:
raise Exception(
"The libs Blue and Black were selected, but you need to choose "
"just one of them."
)

for now it is used for the same thing, but the user maybe would like to use make for a different purpose, so at the end of the project creation the user would need to rewrite the Makefile

scicookie uses both for the same purpose, so that is why makim excludes some usage of make if both are selected, but (in the case both are selected) we should ensure that the make is installed and the Makefile is created, but makim should be used in workflows (because make will be probably used for another thing)

does it make sense?

@xmnlab
Copy link
Member Author

xmnlab commented Aug 30, 2023

It seems that currently there is no code for removing the makim file or makefile regarding to the user selection.
I will fix that in this PR too. I am on it now

@xmnlab
Copy link
Member Author

xmnlab commented Aug 30, 2023

@Saransh-cpp @Anavelyz I addressed the points you made and added a new change that removes Makefile or .makim.yaml if their tools are not selected.

@xmnlab
Copy link
Member Author

xmnlab commented Aug 30, 2023

I also fixed an issue with hatch as well in the smoke tests.
@Saransh-cpp @Anavelyz let me know if you have any other comments here or if it is ready to go :)

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Awesome, looks good now! Thanks, @xmnlab!

@xmnlab
Copy link
Member Author

xmnlab commented Aug 31, 2023

@Saransh-cpp thanks for the review!

@xmnlab xmnlab merged commit 12efe9a into osl-incubator:main Aug 31, 2023
11 checks passed
@xmnlab xmnlab deleted the fix-configurations branch August 31, 2023 02:05
@github-actions
Copy link

🎉 This PR is included in version 0.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants