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

Add CI #12

Merged
merged 6 commits into from
Apr 18, 2024
Merged

Add CI #12

merged 6 commits into from
Apr 18, 2024

Conversation

maxmynter
Copy link
Collaborator

@maxmynter maxmynter commented Apr 18, 2024

Set up a first version of a CI for the jobs repo.
Implements automated tests and running the pre-commit on pull request and push.
Largely inspired but reduced from what we have at nnbench.

@maxmynter maxmynter force-pushed the gh-actions branch 7 times, most recently from 612235e to cfa3681 Compare April 18, 2024 09:11
@maxmynter maxmynter marked this pull request as ready for review April 18, 2024 09:31
both now use the labels as a nested list.
@maxmynter maxmynter force-pushed the gh-actions branch 2 times, most recently from 5dff66a to 102bfd3 Compare April 18, 2024 11:41
@nicholasjng
Copy link
Collaborator

nicholasjng commented Apr 18, 2024

The definition likely needs to become AnyPath = Union[str, os.PathLike[str], Path]. (If we even need the Path to begin with - let's check)

EDIT: This suggests that Union[str, PathLike[str]] is the way, endorsed by typeshed: https://stackoverflow.com/questions/69673650/os-pathlikeany-vs-os-pathlikestr

PathLike itself is available since 3.6, so we're good. https://docs.python.org/3/library/os.html#os.PathLike

as TypeAlias is introduced in Python 3.10, but removing it, we can
keep 3.9 as oldest supported Python.
it was introduced in Python 3.10 and we therefore
check and only apply when it is available.

Also make the dataclasses of the config frozen and
adjust the __post_init__'s accordingly.
@maxmynter
Copy link
Collaborator Author

maxmynter commented Apr 18, 2024

To stay compliant with Python 3.9, i

  • Migrated the TypeAlias to Union
  • Make the slots argument of the dataclass dependent of its availability in Python 3.10 (see here)
  • Future imports

Also made the dataclasses frozen, as a config should not change.

@nicholasjng
Copy link
Collaborator

Needs a few more from __future__ import annotations imports, otherwise we're good!

@maxmynter maxmynter merged commit 4155568 into main Apr 18, 2024
2 checks passed
@maxmynter maxmynter self-assigned this Apr 23, 2024
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.

3 participants