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

Update repo's layout #627

Closed
wants to merge 48 commits into from
Closed

Update repo's layout #627

wants to merge 48 commits into from

Conversation

GuillemBarroso
Copy link
Contributor

@GuillemBarroso GuillemBarroso commented Nov 18, 2022

Fix #296.

Using the dev guide recommendations and other PyAnsys repos, I tried to address issue #296.

Changes:

  • Move ansys/dpf/core inside src/ directory.
  • Add tox.ini and .pre-commit-config.yaml.
  • Use pyproject.toml instead of setup.py
  • Since pyproject.toml handles the version as well, I have removed the _version.py and added the server versions in __init__.py.

The only change that will be needed after this is to rename the branch master to main.

Copy link
Member

@jorgepiloto jorgepiloto left a comment

Choose a reason for hiding this comment

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

Just left some minor comments. This is looking good, @GuillemBarroso.

@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #627 (b2a162f) into master (b2a162f) will not change coverage.
The diff coverage is n/a.

❗ Current head b2a162f differs from pull request most recent head 33b03d5. Consider uploading reports for the commit 33b03d5 to get more accurate results

@@           Coverage Diff           @@
##           master     #627   +/-   ##
=======================================
  Coverage   86.63%   86.63%           
=======================================
  Files          69       69           
  Lines        7750     7750           
=======================================
  Hits         6714     6714           
  Misses       1036     1036           

@GuillemBarroso GuillemBarroso force-pushed the feat/update-layout branch 4 times, most recently from 3c8f445 to 518183f Compare November 23, 2022 12:41
except ModuleNotFoundError:
import importlib_metadata

__version__ = importlib_metadata.version("ansys-dpf-core")
Copy link
Member

Choose a reason for hiding this comment

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

Use __name__ here. It avoids hardcoding the namespace of the package:

Suggested change
__version__ = importlib_metadata.version("ansys-dpf-core")
__version__ = importlib_metadata.version(__name__.replace(".", "-"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I had this before. However, I was getting the following error in the Test docstrings step: "importlib.metadata.PackageNotFoundError: core".

With @germa89 we realized that this was fixed by hard-coding the name. I will try to investigate this a bit more.

Copy link
Contributor

Choose a reason for hiding this comment

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

Normally I would agree with @jorgepiloto ... but in this case, for some reason, we needed to provide the hardcoded package name to avoid import issues.

@PProfizi PProfizi added the maintenance Repository structure maintenance label Nov 25, 2022
@GuillemBarroso GuillemBarroso self-assigned this Nov 29, 2022
@GuillemBarroso
Copy link
Contributor Author

Closing this PR as I was trying to do too many things at once.

In the new PRs I will go one step at a time.

@PProfizi PProfizi deleted the feat/update-layout branch November 28, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Repository structure maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update package layout to PyAnsys guidelines
4 participants