Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
run: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install tox numpy

- name: Check metadata consistency
run: python scripts/check_metadata.py

- name: Execute Python tests
run: tox
Expand Down
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,50 @@ pre-commit install
# 5. Run tests
cd test/unit
python -m pytest -v

```

## Supported Environments

To help contributors get started quickly, below is a summary of supported environments and testing expectations.

### Python Support
Metaflow primarily supports Python versions:

- Python 3.9+
- Recommended: Python 3.10 or newer
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated

Please ensure your local environment matches one of the supported versions.

---

### R Support
Metaflow includes limited support for R components. However:

- Most development and testing workflows are Python-focused
- R support may not be fully covered in CI

Contributors working on R-related features should validate changes locally.
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated

---

### CI Validation
Continuous Integration (CI) runs automated tests on:

- Supported Python versions (via GitHub Actions)
- Core functionality and workflows

CI ensures that contributions do not break existing functionality.

---

### Local Testing Guide

Before submitting a PR, contributors should run:

```bash
pip install -e .
pytest
```

**That's it!** Now read the requirements below before submitting your PR.
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Expand Down
64 changes: 64 additions & 0 deletions scripts/check_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import configparser
import re
import sys


def read_setup_cfg():
config = configparser.ConfigParser()
config.read("setup.cfg")

return {
"name": config.get("metadata", "name", fallback=None),
"version": config.get("metadata", "version", fallback=None),
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.


def read_setup_py():
with open("setup.py", "r") as f:
content = f.read()

name_match = re.search(r"name\s*=\s*['\"](.+?)['\"]", content)

return {
"name": name_match.group(1) if name_match else None,
}


def read_version_file():
with open("metaflow/version.py", "r") as f:
line = f.read().splitlines()[0]

version = line.split("=")[1].strip(" \"'")
return version


def main():
cfg = read_setup_cfg()
py = read_setup_py()
version = read_version_file()

errors = []

# Compare package name
if cfg["name"] and py["name"] and cfg["name"] != py["name"]:
errors.append(
f"Name mismatch: setup.cfg='{cfg['name']}' vs setup.py='{py['name']}'"
)

# Compare version
if cfg["version"] and version and cfg["version"] != version:
errors.append(
f"Version mismatch: setup.cfg='{cfg['version']}' vs version.py='{version}'"
)

if errors:
print(" Metadata consistency check FAILED:\n")
for err in errors:
print(f"- {err}")
sys.exit(1)

print(" Metadata consistency check PASSED")


if __name__ == "__main__":
main()