Skip to content

Update contributing guide, remove dev-facing ci optional dependency #4463

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

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Jul 26, 2025

Summary

  • Migrate test/lint workflow to uv
  • Remove dev-facing ci optional dependency group as it's not user facing and we're not including tests in the wheels anyway:

pyproject.toml Outdated
@@ -325,6 +325,9 @@ reportMissingModuleSource = false
reportInvalidTypeForm = false
exclude = ["**/tests"]

[tool.uv]
default-groups = ["dev", "lint"]
Copy link
Contributor Author

@DanielYang59 DanielYang59 Jul 26, 2025

Choose a reason for hiding this comment

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

uv would only install dev by default, linting tools then would not be available by uv sync (one would need uv sync --group lint, but I assume there isn't any reason not to install linting tools for development?):

By default, uv includes the dev dependency group in the environment (e.g., during uv run or uv sync).

pymatgen/pyproject.toml

Lines 328 to 345 in f9d9fe8

[dependency-groups]
dev = [
"invoke>=2.2.0",
"jupyter>=1.1.1",
"pre-commit>=4.2.0",
"pytest>=8.3.5",
"pytest-cov>=6.0.0",
"pytest-split>=0.10.0",
"ruff>=0.11.3",
"sphinx>=8.1.3",
"sphinx-markdown-builder>=0.6.8",
"sphinx-rtd-theme>=3.0.2",
]
lint = [
"mypy>=1.15.0",
"pyright>=1.1.398",
"ruff>=0.11.2",
]

# Install from wheels to test the content
uv build --wheel --no-build-logs
WHEEL_FILE=$(ls dist/pymatgen*.whl)
uv pip install $WHEEL_FILE[${{matrix.config.extras}}] --resolution=${{matrix.config.resolution}}

- name: Install DGL and MatGL specially on ubuntu.
Copy link
Contributor Author

@DanielYang59 DanielYang59 Jul 26, 2025

Choose a reason for hiding this comment

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

Looks like this install step isn't really runninng as our test matrix only has python 3.13 for Ubuntu:

config:
- os: windows-latest
python: "3.11"
resolution: highest
extras: ci,optional,prototypes
- os: windows-latest
python: "3.11"
resolution: highest
extras: ci,prototypes,optional,numpy-v1 # Test NP1 on Windows (quite buggy ATM)
- os: ubuntu-latest
python: "3.13"
resolution: lowest-direct
extras: ci,prototypes,optional
- os: macos-latest
python: "3.12"
resolution: lowest-direct
extras: ci,prototypes # test with only required dependencies installed

For example https://github.com/materialsproject/pymatgen/actions/runs/16538944868/job/46777460136:
image

@DanielYang59 DanielYang59 changed the title Update contributing guide Update contributing guide, remove dev-facing ci optional dependency Aug 10, 2025
@DanielYang59 DanielYang59 force-pushed the update-contributing-guide branch 3 times, most recently from eb18d84 to 58c4743 Compare August 10, 2025 12:02
@DanielYang59 DanielYang59 force-pushed the update-contributing-guide branch 6 times, most recently from 75ce557 to fab8ec1 Compare August 10, 2025 16:18
DEBUG: why moyopy is not available when it's installed?

DEBUG: revert some changes

Revert "DEBUG: why moyopy is not available when it's installed?"

This reverts commit 5036d54.

uv run

try to remove explicit active again

emmm nope, still need manual activation

remove manual activate again, but I don't think uv run would re-sync
venv?
@DanielYang59 DanielYang59 force-pushed the update-contributing-guide branch from 1eb1fc8 to 98656d0 Compare August 10, 2025 16:48
@DanielYang59 DanielYang59 marked this pull request as ready for review August 10, 2025 17:03
@DanielYang59 DanielYang59 requested a review from mkhorton as a code owner August 10, 2025 17:03
@DanielYang59 DanielYang59 marked this pull request as draft August 13, 2025 11:52
@DanielYang59
Copy link
Contributor Author

I just noticed there's another docs/contributing.md...I'm a bit confused here, which should be the main doc (invoke make-doc doesn't seem to sync these two)

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