Skip to content

Revert GitHub workflow#111

Merged
Davidek523 merged 20 commits intomainfrom
revert-.github-workflow
Mar 19, 2025
Merged

Revert GitHub workflow#111
Davidek523 merged 20 commits intomainfrom
revert-.github-workflow

Conversation

@ultimateownsz
Copy link
Collaborator

Revert Pull Request Template

Summary

This PR fixes changes made in PR #99 and simplifies the management of CI workflows by using a reusable workflow (lint_and_test.yml) from the .github repository.

Note

Full testing of the reusable workflow requires merging this PR. Testing locally verifies that the .toml configuration works as expected, but integration with the reusable workflow can only be confirmed after merging or updating references to a test branch.

Key Changes:

  1. Introduced the reusable workflow call:
    • Refactored this repository’s workflow to leverage the global .github repository.
    • Allows the .github repository to manage Python linting (ruff) and type-checking (mypy) logic in one place.
  2. Future-proofed workflows:
    • Enables seamless updates for all repositories by making changes in one global location.
    • Provides flexibility for adding other reusable workflows (e.g., testing, deployment) in the .github repository.
  3. Project specific configuration
  • Added a .toml file to define ruff and mypy settings for the project.
    • Ruff enforces formatting, fixes import issues, and detects unused variables.
    • Mypy type-checks the codebase while ignoring missing type stubs for specific libraries (pygame for example)
  1. Renamed branch to correct naming convention

Steps for testing the changes

To validate these changes:

  1. Merge this branch into your working branch:
    • Use the following command:
git merge <branch-name-of-this-pr>
  • Resolve any merge conflicts, if applicable
  1. Run the commands listed in the README to test locally:
  2. Push your updated branch to trigger the CI workflow:
  • When triggered, it will show you if you have done it correctly, if not you can see where it failed.
  1. Verify CI results:
  • Confirm that the workflow runs as expected and passes.
  1. If the changes work as intended, complete your review and approve this PR.

Reviewer notes

  • These changes centralize linting and type-checking using a reusable workflow from the .github repository.
  • Full integration testing requires merging this branch into your working branch, as described in the testing instructions.

Please review and approve the changes to adopt the reusable workflow approach.

Related Issues

This PR fixes issue(s) #99 the license URL in the README was broken, also made some other fixes to the structure of the README.


✅ Checklist:

  • 🛠️ I have tested my code, and it works as expected (e.g., game runs without errors).
  • 📝 I have made sure that the code follows the project's formatting and style guidelines.

this will revert the .github workflow that @PurpleProg helped with, only thing that is added now is to have it check on python files, so any markdown or yml configurations will not use this workflow anymore
…ub repository

- Updated the workflow to use the reusable workflow `lint_and_test.yml` from the PyCeas/.github repository.
- Simplified workflow maintenance by centralizing the logic in the `.github` repository.
- Removed duplication of Python version management and dependency installation logic in individual workflows.
- Added flexibility for future updates and enhancements to global workflows.
This will fix the readme once again, just some things I forgot since my last PR, it will make the changes more clear and better to read.
testing if the linter now properly works on .py files
This reverts commit 63876fe.
testing out if the workflow works again properly
this will help by reducing to put in some things like ignore imports for mypy. import pygame is a good example for this, since the pip package is called pygame-ce it is still referred as pygame and mypy brakes on this for some reason.
this adds the message in settings.py why some imports are not type checked because of, see previous commit.
line length is 120
correct ruff commands added
removed mypy commands no longer needed
when running the commands from the readme it will make it more clear what needs to be changed and where exactly
from different files, mypy didn't like it so no it should be ignored by the toml config
for safety reasons i added # type: ignore to  not let mypy typecheck pygame imports
This will help make the instructions for setting up pyceas via a virtual environment for multiple os's
- Enabled .idea/ in the .gitignore to ensure that all PyCharm-specific project files are ignored.
- This prevents unnecessary files such as workspace.xml, caches, and other IDE-specific settings from being committed to version control.
- Helps maintain a cleaner repository and avoids conflicts with collaborators using different environments or IDEs.
Copy link
Collaborator

@Davidek523 Davidek523 left a comment

Choose a reason for hiding this comment

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

When running the commands it doesnt work

image
image

(I have installed all the dev requirements)

@ultimateownsz
Copy link
Collaborator Author

image
I did the same and had this, is ruff and mypy really installed locally? You can check pip show ruff and pip show ruff

Copy link
Collaborator

@Davidek523 Davidek523 left a comment

Choose a reason for hiding this comment

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

Could you show me the commands you used??

@ultimateownsz
Copy link
Collaborator Author

ultimateownsz commented Mar 15, 2025

Could you show me the commands you used??

Yes I used these, but it depends what you use. If your terminal is powershell you can use these, otherwise use the git bash commands

ruff format .;
ruff check --include I --fix .;
ruff check .;
mypy main.py

Copy link
Collaborator

@Davidek523 Davidek523 left a comment

Choose a reason for hiding this comment

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

I used these commands with powershell and got the problem

@ultimateownsz
Copy link
Collaborator Author

ultimateownsz commented Mar 15, 2025

When running the commands it doesnt work

image image

(I have installed all the dev requirements)

There might be a problem where your ruff path is located in, in order for this to bypass could you try and test it if this works via creating a virtual environment stated in the readme.

@ultimateownsz
Copy link
Collaborator Author

image
This is my path of where my ruff is installed, perhaps your path is different from mine.

Copy link
Collaborator

@Davidek523 Davidek523 left a comment

Choose a reason for hiding this comment

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

Works good without any issues or erros!

@Davidek523 Davidek523 merged commit d8d3b3e into main Mar 19, 2025
2 checks passed
@ultimateownsz ultimateownsz deleted the revert-.github-workflow branch May 29, 2025 20:54
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.

2 participants

Comments