-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 17ff62f
Showing
43 changed files
with
7,669 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Check http://editorconfig.org for more information | ||
# This is the main config file for this project: | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
trim_trailing_whitespace = true | ||
indent_size = 4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, caste, color, religion, or sexual | ||
identity and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Community leaders 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, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[INSERT CONTACT METHOD]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining | ||
the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed | ||
unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing | ||
clarity around the nature of the violation and an explanation of why the | ||
behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series of | ||
actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No | ||
interaction with the people involved, including unsolicited interaction with | ||
those enforcing the Code of Conduct, for a specified period of time. This | ||
includes avoiding interactions in community spaces as well as external channels | ||
like social media. Violating these terms may lead to a temporary or permanent | ||
ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including | ||
sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public | ||
communication with the community for a specified period of time. No public or | ||
private interaction with the people involved, including unsolicited interaction | ||
with those enforcing the Code of Conduct, is allowed during this period. | ||
Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community | ||
standards, including sustained inappropriate behavior, harassment of an | ||
individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within the | ||
community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.1, available at | ||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
||
Community Impact Guidelines were inspired by | ||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at | ||
[https://www.contributor-covenant.org/translations][translations]. | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
[Mozilla CoC]: https://github.com/mozilla/diversity | ||
[FAQ]: https://www.contributor-covenant.org/faq | ||
[translations]: https://www.contributor-covenant.org/translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Contributing to `nearness` | ||
|
||
Thanks for contributing! Before implementing features and changes, please submit an issue to discuss the proposed | ||
changes. | ||
|
||
## How to submit a pull request | ||
|
||
1. [Fork this repository](https://github.com/davnn/nearness/fork). | ||
2. Clone the forked repository and add a new branch with the feature name. | ||
|
||
Before submitting your code as a pull request please do the following steps: | ||
|
||
1. Add any changes you want | ||
2. Add tests for the new changes | ||
3. Edit documentation if you have changed something significant | ||
4. Run `task format` to format your changes. | ||
5. Run `task lint` to ensure code style checks. | ||
6. Run `task typing` to ensure type checks. | ||
7. Run `task safety` to ensure safety checks. | ||
8. Run `task test` to verify that all tests are passing. | ||
|
||
Conveniently, you can run `task check`, to combine the mentioned commands before contributing a commit. | ||
We use [gitmoji](https://gitmoji.dev/) to categorize different kinds of commits. | ||
|
||
## Contributing without `task` | ||
|
||
We use [task](https://taskfile.dev/) to provide pre-configured CLI commands for the project, but `task` is | ||
not required, you can also run the commands directly from the CLI. Have a look at `Taskfile.yml` for a reference of | ||
commands. | ||
|
||
## Set up a poetry environment | ||
|
||
We use [micromamba](https://github.com/mamba-org/mamba) to set up a Python environment | ||
for [poetry](https://python-poetry.org/). Make sure that ``micromamba`` is installed | ||
and available. Run `task env-create` to create an empty Python 3.10 environment named `nearness`. After you have | ||
successfully created the environment activate it with `micromamba activate nearness`. If `poetry` is not already | ||
installed, run `task poetry-install`. Using the activated `nearness` environment check if poetry is using the right | ||
environment with `poetry env info`. Once the poetry setup is complete, you are ready to install the dependencies. | ||
|
||
Note that Conda, Mamba or Micromamba is not necessary, you can use a tool of your choice to manage your Python | ||
environment. One benefit of using Conda is that we can override packages that are not easy to install with `pip`, | ||
for example, dependencies with GPU-support. | ||
|
||
## Install dependencies | ||
|
||
We use [`poetry`](https://github.com/python-poetry/poetry) to manage the dependencies. With an active poetry env, | ||
run `task install` to install all dependencies into environment. After the dependencies are installed, run | ||
`task pre-commit-install` to add the [pre-commit](https://pre-commit.com/) hooks. | ||
|
||
## Other help | ||
|
||
You can contribute by spreading a word about this library. It would also be a huge contribution to write a short article | ||
on how you are using this project. You can also share your best practices with us. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: 🐛 Bug report | ||
description: Report an issue | ||
title: "🐛 <Please write a comprehensive title and keep the 🐛 prefix>" | ||
labels: [ bug ] | ||
|
||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to fill out this bug report! | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: Describe the bug | ||
description: A clear description the bug. If you want to contribute to fix this issue, tell us in the description. | ||
placeholder: Description | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: Reproduction | ||
description: A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is **required**, otherwise the issue might be closed without further notice. | ||
placeholder: Reproduction | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: system-info | ||
attributes: | ||
label: System Info | ||
description: Output of `task sysinfo` | ||
render: Shell | ||
placeholder: Paste the output of the following command | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: validations | ||
attributes: | ||
label: Validations | ||
description: Before submitting the issue, please make sure you do the following | ||
options: | ||
- label: Read the [Contributing Guide](https://github.com/davnn/nearness/blob/main/.github/CONTRIBUTING.md). | ||
required: true | ||
- label: Check that there isn't already an issue that reports the same bug to avoid creating duplicates. | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Configuration: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: ⁉ Questions and Discussions | ||
url: https://github.com/davnn/nearness/discussions | ||
about: Please do not use issues for question and discussion. | ||
- name: 😍 Contribution Guide | ||
url: https://github.com/davnn/nearness/blob/main/.github/CONTRIBUTING.md | ||
about: Please read through before making a contribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: 📝 Documentation improvement | ||
description: Something is erroneous, unclear or missing in the docs. | ||
title: "📝 <Please write a comprehensive title and keep the 📝 prefix>" | ||
labels: [ documentation ] | ||
|
||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to help us improve the documentation! | ||
- type: textarea | ||
id: documentation-description | ||
attributes: | ||
label: Description | ||
description: 'Explain how you would like to improve the docs here!' | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: checkboxes | ||
attributes: | ||
label: Validations | ||
description: Before submitting the issue, please make sure you do the following | ||
options: | ||
- label: Read the [Contributing Guide](https://github.com/davnn/nearness/blob/main/.github/CONTRIBUTING.md). | ||
required: true | ||
- label: Check that there isn't already an issue requesting the same. | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 🚀 Feature proposal or enhancement | ||
description: Propose a new feature or enhancement | ||
title: "🚀 <Please write a comprehensive title and keep the 🚀 prefix>" | ||
labels: [ feature ] | ||
|
||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for your interest in the project and taking the time to fill out this feature report! | ||
- type: textarea | ||
id: feature-description | ||
attributes: | ||
label: Description of the problem | ||
description: 'As a user I want [goal] so that [benefit]. If you want to contribute with a PR, tell us in the description. Thanks!' | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: suggested-solution | ||
attributes: | ||
label: Solution | ||
description: 'We could provide following implementation...' | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: checkboxes | ||
attributes: | ||
label: Validations | ||
description: Before submitting the issue, please make sure you do the following | ||
options: | ||
- label: Read the [Contributing Guide](https://github.com/davnn/nearness/blob/main/.github/CONTRIBUTING.md). | ||
required: true | ||
- label: Check that there isn't already an issue requesting the same feature. | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Description | ||
|
||
<!-- Add a more detailed description of the changes if needed. --> | ||
|
||
## Related Issue | ||
|
||
<!-- If your PR refers to a related issue, link it here. --> | ||
|
||
## Type of Change | ||
|
||
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) --> | ||
|
||
- [ ] 🔧 Bug fix | ||
- [ ] 🔐 Security fix | ||
- [ ] 🚀 Improvement / New feature | ||
- [ ] 📚 Examples / Docs / Tutorials | ||
|
||
## Checklist | ||
|
||
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) --> | ||
|
||
- [ ] I've checked the code using `task check`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Release drafter configuration https://github.com/release-drafter/release-drafter#configuration | ||
# Emojis were chosen to match the https://gitmoji.carloscuesta.me/ | ||
|
||
name-template: "v$NEXT_PATCH_VERSION" | ||
tag-template: "v$NEXT_PATCH_VERSION" | ||
|
||
categories: | ||
- title: ":rocket: Features" | ||
labels: [ feature, enhancement ] | ||
- title: ":wrench: Fixes & Refactoring" | ||
labels: [ bug, fix, refactoring ] | ||
- title: ":package: Build System & CI/CD" | ||
labels: [ build ] | ||
- title: ":boom: Breaking Changes" | ||
labels: [ breaking ] | ||
- title: ":pencil: Documentation" | ||
labels: [ documentation ] | ||
- title: ":arrow_up: Dependencies updates" | ||
labels: [ dependencies ] | ||
|
||
template: | | ||
## What’s Changed | ||
$CHANGES | ||
## :busts_in_silhouette: List of contributors | ||
$CONTRIBUTORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import json | ||
import platform | ||
import sys | ||
|
||
import nearness | ||
|
||
|
||
def get_system_info(): | ||
info = { | ||
"library": nearness.get_version(), | ||
"python": sys.version, | ||
"platform": platform.platform(), | ||
"architecture": platform.machine(), | ||
} | ||
return info | ||
|
||
|
||
if __name__ == "__main__": | ||
print(json.dumps(get_system_info(), indent=4)) |
Oops, something went wrong.