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

Replace setup.py with pyproject.toml, update actions to latest versions #865

Merged
merged 14 commits into from
Jan 23, 2025

Conversation

chrisjonesBSU
Copy link
Contributor

PR Summary:

Same as the PR made over in mBuild mosdef-hub/mbuild#1217

It's recommended to use pyproject.toml instead of setup.py and gets rid of the deprecation error when running pip install . inside the repo.

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.85%. Comparing base (c8c62ae) to head (6459585).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #865      +/-   ##
==========================================
- Coverage   94.07%   89.85%   -4.23%     
==========================================
  Files          65       65              
  Lines        6953     6976      +23     
==========================================
- Hits         6541     6268     -273     
- Misses        412      708     +296     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chrisjonesBSU
Copy link
Contributor Author

The failing bleeding edge test is related to this issue. Haven't had a chance to take a look yet.

Copy link
Contributor

@CalCraven CalCraven left a comment

Choose a reason for hiding this comment

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

This looks ready to merge.

@chrisjonesBSU
Copy link
Contributor Author

I can't re-create the bleeding edge test errors locally. It seems like an issue with lark. After all the updates to the environment from other .yml files, I wonder if the lark version is an older one.

      def __init__(self, optional_names=""):
          if optional_names:
              for n in optional_names:
                  if not n.startswith("_"):
                      raise FoyerError(
                          "Non-element types must start with an underscore, you passed {}".format(
                              ", ".join(optional_names)
                          )
                      )
      
              optional_names = sorted(optional_names, reverse=True)
              self.grammar = GRAMMAR.format(
                  optional="{}|".format("|".join(optional_names))
              )
      
          else:
              self.grammar = GRAMMAR.format(optional="")
  >       self.PARSER = lark.Lark(self.grammar, parser="lalr")
  E       AttributeError: module 'lark' has no attribute 'Lark'

@chrisjonesBSU
Copy link
Contributor Author

Ok, the environment has lark 1.2.2, but still gets this attribute error.

With lark 1.2.2, I don't get an attribute error

>>> import lark
>>> lark.__version__
'1.2.2'
>>> lark.Lark
<class 'lark.lark.Lark'>

@CalCraven
Copy link
Contributor

This looks wrong in line 52 under the Bleeding Edge Stage (Check Environment)
focefield_utilities 0.3.0+12.ga23b12a pypi_0 pypi
Just wanted to point that out.

We also are getting lark 1.2.2, but wonder if the issues lies in this odd downgrade of mBuild and Foyer, then reinstalling from source. Essentially, since the packages depend on each other, installing the dependencies of each may cause some self-reference issue. There's some reference to some weird "already existing files" happening during the linking step

@chrisjonesBSU
Copy link
Contributor Author

Yeah, I noticed the bleeding edge test isn't using the latest version of mBuild. I wonder if we should have yet another .yml file for running bleeding edge tests? That way, it installs everything in one go. We can install mbuild, foyer and forcefield_utitilities via pip in the yml file. This might be a more manageable and accurate way to do bleeding edge tests rather than running mamba update 3 different times.

@chrisjonesBSU
Copy link
Contributor Author

Yeah, I noticed the bleeding edge test isn't using the latest version of mBuild. I wonder if we should have yet another .yml file for running bleeding edge tests? That way, it installs everything in one go. We can install mbuild, foyer and forcefield_utitilities via pip in the yml file. This might be a more manageable and accurate way to do bleeding edge tests rather than running mamba update 3 different times.

I added this out of curiosity, we can still talk about it and switch it back if we decide not to go this route.

@CalCraven
Copy link
Contributor

Looks like it's working as expected now. I'd say in general this is better practice since it will decrease confusion when the environments get updated.

@CalCraven
Copy link
Contributor

Current bleeding edge test gets Foyer 1.0.0, mBuild 1.0.0, and GMSO 0.0.0.

Looks good, other than the pip install for GMSO now is naming the wheel with the wrong version.

@chrisjonesBSU
Copy link
Contributor Author

Looks like it's working as expected now. I'd say in general this is better practice since it will decrease confusion when the environments get updated.

Agreed. Should we have a new .yml file for this, as it is now, or should this new one become environment-dev.yml? This is basically a mosdef dev environment, rather than GMSO specific one. Whatever we decide, I'll make the same change in current mbuild PR, then in foyer in a new PR.

@CalCraven
Copy link
Contributor

I think your point is reasonable, this can essentially be a single dev environment. If you're going to be developing the packages, there aren't that many extra dependencies across all of them.

@chrisjonesBSU
Copy link
Contributor Author

Current bleeding edge test gets Foyer 1.0.0, mBuild 1.0.0, and GMSO 0.0.0.

Looks good, other than the pip install for GMSO now is naming the wheel with the wrong version.

This should be fixed now.

@chrisjonesBSU
Copy link
Contributor Author

Ok, so just to clarify, gmso, foyer and mbuild will essentially all have the same environment-dev.yml file, but each one will install the other 2 packages from source instead of from conda. This file can be used to run bleeding edge tests instead of cloning, updating, and installing from source in the CI.yaml workflows for each repoi.

@CalCraven
Copy link
Contributor

I'm still confused as to what this package is. It looks like a typo somewhere for forcefield_utilities.
https://github.com/mosdef-hub/gmso/actions/runs/12920432658/job/36032738911?pr=865#step:5:69

@CalCraven
Copy link
Contributor

Found the culprit.

@chrisjonesBSU
Copy link
Contributor Author

Found the culprit.

I'll make a PR to fix that. I need to update the versioning in the .toml file over there as well.

@CalCraven CalCraven merged commit 8b3cf4b into mosdef-hub:main Jan 23, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants