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

WIP: 3.10 move and refactor #80

Closed
wants to merge 1 commit into from
Closed

Conversation

pm5k
Copy link
Collaborator

@pm5k pm5k commented May 12, 2022

Abstract

Move to Python 3.10, now uses Poetry, added formatter, linter and sorter, other changes added.
This is a WIP PR and will need some input from others. Feedback encouraged.

Action Taken

  • Moved the project to Poetry for a better experience in local dev and packaging the final product. Will aid us later when dockerising. Once poetry is installed on the dev's system the project can now be set up by simply cloning the project, running poetry install in the root of the project and then poetry shell to switch to the virtual environment. CLI can now be run with poetry run cli. More actions can be defined later.

  • Moved to use pytest (pretty sure we weren't using this before). Tests can now be run by ensuring you're in the virtual env (poetry shell) and then run pytest or for verbose output pytest -v or for specific files pytest path/to/some/test_file.py

  • Moved to use isort - a tool that nicely sorts out and separates imports for modules neatly and without you having to think much.

  • Moved to use black - no more quibbling for code style. Just run black when you're finished coding or set it up to be used as the default VSCode formatter for the project (in your .vscode/ folder in the project) and it will format the code according to the default black specification.

  • Moved to use flake8 - default linter for the project from now on. Use it as - flake8 PyPoE/ from the project root to lint the main project. This is supposed to be eventually used to increase the repo code quality. It will report on common errors like:

    • Unused imports
    • Code cognitive complexity being too high (code requires splitting up)
    • Silly mistakes like code that does nothing but waste cpu.
    • Unassigned variables
    • ..so much more.
  • Moved to use Python 3.10 and all the improvements that come with it (poetry will use this if its installed in your system) and it should now be the de-facto required version for this repo.

  • Ran the aforementioned tools on the repo to do initial tidy up (Flake8 was skipped, because it requires manual intervention).

Caveats

Merge this carefully and with a lot of review. I ran some cli stuff on my Mac but I would like someone with a unix or windows machine to test it fully using a known spec and a good ggpk.

FAO

@angelic-knight @AlphSpirit @Journeytojah

@pm5k
Copy link
Collaborator Author

pm5k commented Dec 12, 2022

Closing as this it both too OOS and too out of date

@pm5k pm5k closed this Dec 12, 2022
PoE Wiki - PyPoE Tool dev automation moved this from On hold to Done Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

2 participants