|
1 | | -# Contributing to Hypergraphx on GitHub |
| 1 | +# Contributing to Hypergraphx |
2 | 2 |
|
3 | | -Follow this step-by-step guide to contribute to Hypergraphx. |
| 3 | +Thanks for contributing to Hypergraphx. |
4 | 4 |
|
5 | | -## 1. Set Up Your GitHub Account |
| 5 | +## Development Setup |
6 | 6 |
|
7 | | -If you haven't already, create a GitHub account at [GitHub.com](https://github.com/). |
8 | | - |
9 | | -## 2. Fork the Repository |
10 | | - |
11 | | -- Go to the main page of the Hypergraphx repository. |
12 | | -- In the top-right corner of the page, click on the "Fork" button. This will create a copy of the repository in your |
13 | | - GitHub account. |
14 | | - |
15 | | -## 3. Clone Your Forked Repository |
16 | | - |
17 | | -- Navigate to your forked repository in your GitHub account. |
18 | | -- Click the "Code" button and copy the URL. |
19 | | -- Open your terminal and navigate to the directory where you want to clone the repository. |
20 | | -- Run the following command: |
21 | | - |
22 | | -```bash |
23 | | -git clone [URL] |
24 | | -``` |
25 | | - |
26 | | -Replace `[URL]` with the URL you copied. |
27 | | - |
28 | | -## 4. Set Upstream Remote |
29 | | - |
30 | | -To keep your forked repository updated with the changes from the original repository, you need to set an upstream |
31 | | -remote: |
32 | | - |
33 | | -- Navigate to the directory of your cloned repository in the terminal. |
34 | | -- Run the following command: |
| 7 | +1. Fork the repository and clone your fork. |
| 8 | +2. Create and activate a virtual environment. |
| 9 | +3. Install the package in editable mode with development dependencies: |
35 | 10 |
|
36 | 11 | ```bash |
37 | | -git remote add upstream https://github.com/HGX-Team/hypergraphx.git |
38 | | -``` |
39 | | - |
40 | | -## 5. Create a New Branch |
41 | | - |
42 | | -Before making any changes, it's a good practice to create a new branch: |
43 | | - |
44 | | -- Navigate to the directory of your cloned repository in the terminal. |
45 | | -- Run the following command to create and switch to a new branch: |
46 | | - |
47 | | -```bash |
48 | | -git checkout -b your-branch-name |
| 12 | +python -m pip install --upgrade pip |
| 13 | +python -m pip install -e ".[dev,viz,temporal]" |
| 14 | +pre-commit install |
49 | 15 | ``` |
50 | 16 |
|
51 | | -## 6. Make Your Changes |
| 17 | +## Local Quality Checks |
52 | 18 |
|
53 | | -- Edit the files or add new files as required. |
54 | | -- Once you've made your changes, save them. |
55 | | -- Format Python code with Black before committing: |
| 19 | +Run these before opening a pull request: |
56 | 20 |
|
57 | 21 | ```bash |
58 | | -black . |
| 22 | +black --check . |
| 23 | +ruff check . |
| 24 | +mypy |
| 25 | +pytest |
| 26 | +python -m build |
| 27 | +twine check dist/* |
59 | 28 | ``` |
60 | 29 |
|
61 | | -- (Recommended) Install pre-commit so formatting happens automatically: |
| 30 | +If you want to run pre-commit hooks across the repository: |
62 | 31 |
|
63 | 32 | ```bash |
64 | | -pre-commit install |
| 33 | +pre-commit run --all-files |
65 | 34 | ``` |
66 | 35 |
|
67 | | -## 7. Commit Your Changes |
| 36 | +## Documentation |
68 | 37 |
|
69 | | -- In the terminal, navigate to the directory of your cloned repository. |
70 | | -- Run the following commands to add and commit your changes: |
| 38 | +Build docs locally when your change affects docs, APIs, or tutorials: |
71 | 39 |
|
72 | 40 | ```bash |
73 | | -git add . |
74 | | -git commit -m "Your commit message here" |
| 41 | +python -m pip install -e ".[docs]" |
| 42 | +make -C docs html |
75 | 43 | ``` |
76 | 44 |
|
77 | | -## 8. Push Your Changes to GitHub |
78 | | - |
79 | | -- Push your changes to your forked repository on GitHub: |
80 | | - |
81 | | -```bash |
82 | | -git push origin your-branch-name |
83 | | -``` |
| 45 | +## Branch and Commit Guidelines |
84 | 46 |
|
85 | | -## 9. Create a Pull Request (PR) |
| 47 | +- Create a focused branch from `main`. |
| 48 | +- Keep pull requests small and scoped to one change. |
| 49 | +- Write clear commit messages in imperative mood (for example: `Add temporal centrality regression test`). |
| 50 | +- Add or update tests for behavioral changes. |
| 51 | +- Update docs when user-facing behavior changes. |
86 | 52 |
|
87 | | -- Go to your forked repository on GitHub. |
88 | | -- Click on the "Pull requests" tab and then click on the "New pull request" button. |
89 | | -- Ensure the base repository is the original Hypergraphx repository and the base branch is the branch you want to merge |
90 | | - your changes into (usually `main`). |
91 | | -- Ensure the head repository is your forked repository and the compare branch is the branch you made your changes in. |
92 | | -- Click on the "Create pull request" button. |
93 | | -- Fill in the PR title and description, explaining your changes. |
94 | | -- Click on the "Create pull request" button to submit your PR. |
| 53 | +## Pull Request Checklist |
95 | 54 |
|
96 | | -## 10. Wait for Review |
| 55 | +- Tests added/updated for new behavior. |
| 56 | +- Local quality checks pass. |
| 57 | +- Docs updated (if relevant). |
| 58 | +- PR description explains motivation, approach, and impact. |
97 | 59 |
|
98 | | -- The maintainers of the Hypergraphx repository will review your PR. |
99 | | -- They might request some changes or improvements. If so, make the required changes in your branch, commit them, and |
100 | | - push them to GitHub. Your PR will be automatically updated. |
| 60 | +## Reporting Bugs and Requesting Features |
101 | 61 |
|
102 | | -## 11. PR Gets Merged |
| 62 | +- Use GitHub Issues for bugs and feature requests. |
| 63 | +- Include a minimal reproducible example for bugs. |
| 64 | +- For security issues, do not open a public issue. See `SECURITY.md`. |
103 | 65 |
|
104 | | -Once your PR is approved, the maintainers will merge it into the main branch of the Hypergraphx repository. |
| 66 | +## Code of Conduct |
105 | 67 |
|
106 | | -**Note:** Always follow the contribution guidelines provided by the repository maintainers, and always be respectful and |
107 | | -constructive in your interactions. |
| 68 | +By participating in this project, you agree to follow the Code of Conduct in `CODE_OF_CONDUCT.md`. |
0 commit comments