Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

# Auto detect text files and perform LF normalization
* text=auto

58 changes: 58 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We pledge to make our community welcoming, safe, and equitable for all.

We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.

## Encouraged Behaviors

While acknowledging differences in social norms, we all strive to meet our community’s expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.

With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:

1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
2. Engaging **kindly and honestly** with others.
3. Respecting **different viewpoints** and experiences.
4. **Taking responsibility** for our actions and contributions.
5. Gracefully giving and accepting **constructive feedback**.
6. Committing to **repairing harm** when it occurs.
7. Behaving in other ways that promote and sustain the **well-being of our community**.

## Restricted Behaviors

We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.

1. **Harassment**. Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
2. **Character attacks**. Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
3. **Stereotyping or discrimination**. Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
4. **Sexualization**. Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
5. **Violating confidentiality**. Sharing or acting on someone’s personal or private information without their permission.
6. **Endangerment**. Causing, encouraging, or threatening violence or other harm toward any person or group.
7. Behaving in other ways that **threaten the well-being** of our community.

### Other Restrictions

1. **Misleading identity**. Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
2. **Failing to credit sources**. Not properly crediting the sources of content you contribute.
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
4. **Irresponsible communication**. Failing to responsibly present content which includes, links or describes any other restricted behaviors.


## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.


## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.



## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 3.0, available at [https://www.contributor-covenant.org/version/3/0/code_of_conduct/](https://www.contributor-covenant.org/version/3/0/code_of_conduct/)
42 changes: 42 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Introduction

Thank you for your interest in contributing to our project! We welcome contributions from the community and appreciate your efforts to help improve our codebase. This document provides guidelines and instructions for contributing to our project.


## Installation

To set up the development environment, please follow these steps:

1. Fork the repository:
```bash
gh repo fork MatchCake/TorchPfaffian
```
2. Clone your forked repository:
```bash
git clone <your-fork-url>
```
3. Navigate to the project directory:
4. Initialize the Virtual Environment using [uv](https://docs.astral.sh/uv/):
```bash
uv sync --dev --extra <extra-option>
```
- Extra options: See the [README.md](../README.md) for details on extra options for installation.
5. Set up Pre-commit hooks:
```bash
uv run pre-commit install
```

# Guidelines

1. When you whish to contribute, please create a new fork of the repository and create a new branch for your changes.
2. Make your changes and commit them with clear and descriptive commit messages.
3. Push your changes to your forked repository.
4. Create a pull request to the main repository on the `dev` branch, describing the changes you have made and why they are necessary.
5. Our team will review your pull request and provide feedback. We may ask for changes or improvements before merging your contribution.
6. Once your contribution is approved, it will be merged into the main repository on the `dev` branch and will eventually be included in the next release.
7. Please ensure that your code follows the project's coding standards and guidelines, and that it includes appropriate tests and documentation.


## Code of Conduct

We expect all contributors to adhere to our code of conduct, which can be found in the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file. This code of conduct outlines our expectations for behavior and communication within the community, and we take it seriously to ensure a welcoming and inclusive environment for all contributors.
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Bug report
description: File a bug report
title: '[BUG]'
labels: "bug :bug:"

body:
- type: markdown
id: description
attributes:
value: |
## Before posting a bug report
Search existing GitHub issues to make sure the issue does not already exist.

# Issue description
Description of the issue - include code snippets in the Source code section below and screenshots if relevant.
- type: textarea
id: expected
attributes:
label: Expected behavior
description: |
What do you expect to happen?
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
description: |
What actually happens?
validations:
required: true
- type: textarea
id: info
attributes:
label: Additional information
description: |
Please provide any additional information here that might be necessary to reproduce the issue.
- type: textarea
id: sourcecode
attributes:
label: Source code
description: Please include a minimal non-working example, or any other code related to the issue.
render: shell
- type: textarea
id: tracebacks
attributes:
label: Tracebacks
description: Please include the error tracebacks related to the issue here.
render: shell
- type: textarea
id: system
attributes:
label: System information
description: Please provide informations about you python version and os. The command `python -c "import sys; print(sys.version, sys.platform)"` can be used to get this information. Provide also the output of `pip list` command.
render: shell
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Existing GitHub issues
options:
- label: I have searched existing GitHub issues to make sure the issue does not already exist.
required: true
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Feature request
description: Suggest a new feature
labels: "enhancement :sparkles:"

body:
- type: markdown
id: description
attributes:
value: |
## Before posting a feature request
Search existing GitHub issues to make sure the issue does not already exist.

# Feature description
Description of the feature request - include code snippets and screenshots here if relevant.
- type: textarea
id: details
attributes:
label: Feature details
description: |
What feature would you like to have?
validations:
required: true
- type: textarea
id: implementation
attributes:
label: Implementation
description: |
Do you have an idea for how this could be implemented? Please include those details here.
- type: dropdown
id: urgency
attributes:
label: How important would you say this feature is?
options:
- "1: Not important. Would be nice to have."
- "2: Somewhat important. Needed this quarter."
- "3: Very important! Blocking work."
validations:
required: true
- type: textarea
id: info
attributes:
label: Additional information
description: |
Please provide any additional information here. Include potential alternative solutions, or workarounds, as well as references, if any.
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Description

Please provide a brief description of the changes you are making in this pull request.

------------------------------------------------------------------------------------------------------------

# Checklist

Please complete the following checklist when submitting a PR. The PR will not be reviewed until all items are checked.

- [ ] All new features include a unit test.
Make sure that the tests passed and the coverage is
sufficient by running
`uv run pytest --session-timeout=600`.
- [ ] All new functions and code are clearly documented.
- [ ] The code passes all pre-commit hooks.
You can do this by running `uvx pre-commit run --all-files`.
- [ ] The code is type-checked using Mypy.
You can do this by running `uv run mypy src tests`.
83 changes: 70 additions & 13 deletions .github/workflows/build_dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ on:
push:
branches: ["main"]

permissions:
contents: write
pull-requests: write
actions: write
checks: write
statuses: write
issues: write
discussions: write
id-token: write

jobs:
Build-Dist:
Expand All @@ -12,35 +21,83 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.2"
python-version: "3.11"
enable-cache: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install wheel
python -m pip install --upgrade build
uv venv .venv
uv sync --locked --dev --extra cpu

- name: Gather new package version
id: version
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
WITH_V: false
DEFAULT_BUMP: patch
DRY_RUN: true

- name: Bump package version in pyproject.toml
run: |
uv version ${{steps.version.outputs.new_tag}}
uv lock

- name: Build dist
run: |
python -m build
uv run python -m build --sdist --wheel --no-isolation --outdir dist/ .
uv run twine check dist/*

- name: Commit
- name: Commit updated pyproject.toml
run: |
git add -f dist
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update dist"
git add pyproject.toml
git add uv.lock
git diff-index --quiet HEAD || git commit -m "Updating version of pyproject.toml"

- name: Push
- name: Push the new pyproject.toml
uses: ad-m/github-push-action@master
with:
github_token: ${{secrets.GITHUB_TOKEN}}
branch: main
force: true
directory: dist

- name: Create Tag
id: tag
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
WITH_V: false
DEFAULT_BUMP: patch
DRY_RUN: false

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.new_tag }}
generate_release_notes: true

- name: Merge 'main' branch -> 'dev' branch
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: dev
message: "Automatic merge from 'main' into 'dev' [skip actions]"
label_name: "gh-actions"
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
verbose: true
Loading
Loading