Skip to content

Conversation

@sneakers-the-rat
Copy link
Contributor

fix #100

my nerves are shot and i am procrastinating making my scipy posters badly

added a basic mypy config, these are just the config settings i like, so requesting review from @Midnighter who had the previous config in there. took out pydantic-specific stuff bc i figure we don't want to assume people will be using pydantic.

i also renamed the option from use_type to use_mypy and changed the prompt text accordingly - everyone should use type annotations :) and also this switch does just enable/disable mypy anyway. i still don't really like how pydoclint has no option for "ignore type annotations in function signatures" and it must be either "all functions must have type signatures" or "no functions may have type signatures" - that's enough of a problem for me that i wouldn't use pydoclint and by proxy this template, but a problem for another time.

other stuff:

  • added exception to the ruff FBT001 rule in test code which i think is silly - it forbids the presence of any positional boolean variables. like ok maybe in some circumstances like the ones they cite in the rule explanation are a code smell but banning an entire type from signatures is overkill, especially in tests.
  • i noticed the non-hatch gh action didn't have the job where mypy is run in the hatch version, so i added that.

@lwasser
Copy link
Member

lwasser commented Jul 2, 2025

Oh, thank you for this. I had this on my list because all of the mypy stuff is commented out in the "full" version of the template. I'll leave to Moritz for review I just wanted to thank you for this!!

Also, get your poster done 🙃

Copy link
Contributor

@Midnighter Midnighter left a comment

Choose a reason for hiding this comment

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

Good changes! Some minor comments that you can take as you like.

help: "Do you want to pre-commit hooks to format your code on save?"

use_types:
use_mypy:
Copy link
Contributor

Choose a reason for hiding this comment

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

I originally went with use_types, as folks might want to run pyright or another alternative to mypy. It's fair to commit to mypy, though, especially as this is targeted more at beginners.

""")

root = generated(use_hatch_envs=use_hatch_envs, use_mypy=True)
pkg_path = root / "src" / "alien_clones"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the name be gotten from the generated project somehow? Would be better than hard-coding it here.

@lwasser
Copy link
Member

lwasser commented Oct 31, 2025

hi friends! I am going to do another bigger-ish review and update of the "FULL" version of this template. I am just letting you know as it could cause merge conflicts here. But I need to do it before next week's workshop. I'll try to keep each PR scoped following the work I just did today in pyosPackage. ✨

@lwasser
Copy link
Member

lwasser commented Nov 3, 2025

I turned off typing for the FULL version for the time being. I think typing it is great, but there is also a sharp learning curve and significant time associated with adding it. I did this mostly because it wasn't configured but also I just wonder if it is "custom" rather than full. For individuals who are well-versed in how they want their package configured. It would be lovely to get this pr merged if we can!! I have implemented some other updates for our workshop this week that conflict here but it is not that significant that a quick rebase won't fix!!

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.

mypy config in pyproject.toml

3 participants