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

Migrate setup configuration to pyproject.toml #175

Merged
merged 5 commits into from
Jul 17, 2024

Conversation

altheaden
Copy link
Collaborator

In this PR I migrated the setup configurations that were previously in setup.cfg, setup.py, and MANIFEST.in into a single pyproject.toml file. The only exception is the configurations for flake8, since it does not yet support pyproject.toml configuration, so its config options have been moved into a new file, .flake8.

Checklist

  • Testing comment in the PR documents testing used to verify the changes

@altheaden altheaden force-pushed the switch-to-pyproject branch from 2dc5f05 to 50d84c3 Compare July 15, 2024 23:55
@altheaden
Copy link
Collaborator Author

Testing

I tested this by running:

conda activate base
conda config --add channels conda-forge 
conda config --set channel_priority strict 
conda create -y -n mache_dev --file spec-file.txt 
conda activate mache_dev 
python -m pip install .

and then testing the installation by running:

mache --help
mache sync --help
mache --version

all of which had the expected output.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Hmm, something isn't quite working right with finding the package and adding the package data. If I run:

$ mache sync diags --help

I see:

Traceback (most recent call last):
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/bin/mache", line 5, in <module>
    from mache.__main__ import main
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/lib/python3.12/site-packages/mache/__main__.py", line 5, in <module>
    from mache import sync
ImportError: cannot import name 'sync' from 'mache' (/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/lib/python3.12/site-packages/mache/__init__.py)

If I look at:

$ ls /gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/lib/python3.12/site-packages/mache/
discover.py  machine_info.py  permissions.py  version.py
__init__.py  __main__.py      __pycache__

it seems like only the python files directly in mache are there and not the subdirectories or their contents.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@altheaden altheaden force-pushed the switch-to-pyproject branch from 50d84c3 to e99e41e Compare July 16, 2024 17:37
@altheaden altheaden mentioned this pull request Jul 16, 2024
1 task
@xylar
Copy link
Collaborator

xylar commented Jul 16, 2024

The latest changes all look great! I'll test it one more time tomorrow (today already!) and merge if the tests work out.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Yep, everything worked great for me this time. I installed the package with:

conda create -y -n mache_dev --file spec-file.txt
conda activate mache_dev
python -m pip install .

Then, the following worked as expected:

mache sync diags --help

and each of these directories had the expected non-python files:

ls /gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/lib/python3.12/site-packages/mache/cime_machine_config/
ls /gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/lib/python3.12/site-packages/mache/machines/
ls /gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mache_dev/lib/python3.12/site-packages/mache/spack/

@xylar
Copy link
Collaborator

xylar commented Jul 17, 2024

@altheaden, very nice work!

@xylar xylar merged commit 911c417 into E3SM-Project:main Jul 17, 2024
6 checks passed
@xylar xylar self-assigned this Jul 17, 2024
@xylar xylar deleted the switch-to-pyproject branch July 17, 2024 08:06
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.

2 participants