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

Setup standard ECS GH workflows #9

Merged
merged 34 commits into from
Jul 18, 2024

Conversation

slactjohnson
Copy link
Contributor

Description

Adds in standard ECS GH workflows.

Motivation and Context

Closes #8

How Has This Been Tested?

Will hopefully be tested when the workflows run on this PR....

@tangkong
Copy link
Contributor

We transitioned to pyproject.toml for specifying test dependencies at some point. Try adding something like this to pyproject.toml

https://github.com/pcdshub/atef/blob/11b15c01dfafd9fe3c6d5ea39afd5844c071c339/pyproject.toml#L39-L40

Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools AddFileFromTemplate
Performed by pcds-migration-tools GitHubActionsMigration
Performed by pcds-migration-tools UpdateSphinx
Performed by pcds-migration-tools RunPyupgrade
Performed by pcds-migration-tools UpdateCondaRecipe
Performed by pcds-migration-tools RunPycln
Performed by pcds-migration-tools PrecommitAutoupdate
Performed by pcds-migration-tools RunPrecommit
@ZLLentz
Copy link
Member

ZLLentz commented Jul 17, 2024

Wow, that's a lot of commits and a well earned "all checks have passed"

@slactjohnson
Copy link
Contributor Author

Thanks! I'd appreciate a once over if you can to see if there's anything weird or missing in the CI. It passes, but that doesn't mean it's correct...

Copy link
Contributor

@tangkong tangkong left a comment

Choose a reason for hiding this comment

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

I think this looks good on the whole, hard fought green checkmarks.

The builds/tests seem to be running as intended. Now it's just up to you to write tests that mean something.

@@ -1,6 +1,6 @@
[run]
source =
btms_ui
btms-ui
Copy link
Contributor

Choose a reason for hiding this comment

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

Your experience here is why I dislike using dashes at all in package names

@@ -34,8 +32,8 @@ def __init__(
self,
x: float = 0.0,
y: float = 0.0,
channel_x: Optional[str] = None,
channel_y: Optional[str] = None,
channel_x: str | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

This syntax was introduced in py3.10, though the from __future__ import annotations lets you use it. I tend to not use it to be safe, but it's fine here it seems

Copy link
Member

Choose a reason for hiding this comment

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

I think one of the linters asks you to change everything to this

Copy link
Contributor

Choose a reason for hiding this comment

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

Interestingly none of the packages I work on do this yet 😆


{% set data = load_setup_py_data() %}

{% set package_name = "btms_ui" %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that both the package name and import name are btms_ui, we might consider renaming the repo and folder structure to use underscores to be consistent

@@ -1,4 +1,3 @@
from . import _version
__version__ = _version.get_versions()['version']
from ._version import __version__ # noqa: F401
Copy link
Member

Choose a reason for hiding this comment

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

This might be missing when running interactively since it's generated by setuptools_scm later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't say I fully understand here, but it's working interactively on my clone. Once this is merged I can set up a clean clone and test that it still works interactively, and if not set up a new issue/PR to resolve that.

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I didn't compare 1:1 with any other repo but to my eyes everything here looks correct aside from the thing that might ImportError for dev clones

pyproject.toml Outdated
description = "Beam Transport Motion System GUI and python code"
dynamic = [ "version", "readme", "dependencies", "optional-dependencies",]
keywords = []
name = "btms-ui"
Copy link
Contributor

Choose a reason for hiding this comment

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

This conflicts with the conda package name being btms_ui. The builds confirm this:

  • pip: btms-ui 0.1.dev135+g9befb1c.d20240717
  • conda: btms_ui 0.1.dev135+g9befb1c py_0 local

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated pyproject.toml to be consistent now

tangkong
tangkong previously approved these changes Jul 18, 2024
Copy link
Contributor

@tangkong tangkong left a comment

Choose a reason for hiding this comment

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

I think this looks good, one last nitpick then I think we're good to merge this and tackle any followup bugs after.

These migration diffs are always hard to parse. Luckily the green check is a good indicator of success

pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: Robert Tang-Kong <35379409+tangkong@users.noreply.github.com>
@slactjohnson
Copy link
Contributor Author

@tangkong I've committed your suggestion to fix README.rst, but now it requires a review again. Can you approve when you get a chance so I can merge?

@slactjohnson
Copy link
Contributor Author

Thank you!

@slactjohnson slactjohnson merged commit 680c878 into pcdshub:master Jul 18, 2024
11 checks passed
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.

Setup GH Actions
3 participants