Skip to content

Commit 3c20e3a

Browse files
committed
add tests, docs, license, workflows
1 parent f53d855 commit 3c20e3a

22 files changed

+1481
-210
lines changed

.github/workflows/pr-checks.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Pull Request Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main, master ]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install Poetry
23+
uses: snok/install-poetry@v1
24+
with:
25+
version: latest
26+
virtualenvs-create: true
27+
virtualenvs-in-project: true
28+
29+
- name: Load cached venv
30+
id: cached-poetry-dependencies
31+
uses: actions/cache@v3
32+
with:
33+
path: .venv
34+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
35+
36+
- name: Install dependencies
37+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
38+
run: poetry install --no-interaction --no-root
39+
40+
- name: Install pre-commit hooks
41+
run: poetry run pre-commit install
42+
43+
- name: Run pre-commit hooks
44+
run: poetry run pre-commit run --all-files
45+
46+
- name: Run tests
47+
run: poetry run pytest tests/ --cov=numt --cov-report=xml
48+
49+
- name: Upload coverage to Codecov
50+
uses: codecov/codecov-action@v3
51+
with:
52+
file: ./coverage.xml
53+
fail_ci_if_error: true
54+
55+
lint:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v3
59+
60+
- name: Set up Python
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: '3.13'
64+
65+
- name: Install Poetry
66+
uses: snok/install-poetry@v1
67+
with:
68+
version: latest
69+
virtualenvs-create: true
70+
virtualenvs-in-project: true
71+
72+
- name: Install dependencies
73+
run: poetry install --no-interaction --no-root
74+
75+
- name: Run Ruff
76+
run: poetry run ruff check .
77+
78+
- name: Run Black
79+
run: poetry run black --check .
80+
81+
- name: Run isort
82+
run: poetry run isort --check-only .
83+
84+
- name: Run mypy
85+
run: poetry run mypy numt/

.github/workflows/publish.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,34 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13-
13+
1414
- name: Set up Python
1515
uses: actions/setup-python@v4
1616
with:
1717
python-version: '3.x'
18-
18+
19+
- name: Install Poetry
20+
uses: snok/install-poetry@v1
21+
with:
22+
version: latest
23+
virtualenvs-create: true
24+
virtualenvs-in-project: true
25+
26+
- name: Load cached venv
27+
id: cached-poetry-dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: .venv
31+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
32+
1933
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install build twine wheel setuptools
23-
34+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
35+
run: poetry install --no-interaction --no-root
36+
2437
- name: Build package
25-
run: |
26-
python -m pip install -e .
27-
python setup.py sdist bdist_wheel
28-
38+
run: poetry build
39+
2940
- name: Publish to PyPI
3041
env:
31-
TWINE_USERNAME: __token__
32-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
33-
run: |
34-
python -m twine upload dist/*
42+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
43+
run: poetry publish --no-interaction

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ __pycache__/
66
*.pyz
77
*.pywz
88
*.pyzw
9-
*.pyzwz
9+
*.pyzwz

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-added-large-files
8+
args: ['--maxkb=4000']
9+
- id: debug-statements
10+
- id: detect-private-key
11+
12+
- repo: https://github.com/psf/black
13+
rev: 24.4.2
14+
hooks:
15+
- id: black
16+
args: ['--line-length=88']
17+
exclude: ^docs/|.*\.(json|yaml|md|txt)$
18+
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
rev: v0.4.2
21+
hooks:
22+
# Run the linter.
23+
- id: ruff
24+
args: ['--fix']
25+
exclude: ^docs/|.*\.(json|yaml|md|txt)$
26+
27+
# Add local hooks to run custom commands
28+
- repo: local
29+
hooks:
30+
- id: run-make-format
31+
name: Run Make Format
32+
entry: make format
33+
language: system
34+
pass_filenames: false

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
3+
## [v0.0.0] - *2023-01-01*
4+
### 🐛 Bug Fixes
5+
### 🛠 Changes
6+
### 🚀 Features
7+
### 🗑 Removed
8+
### 🔐 Security
9+
### 🧹 Chore
10+
### ⚙️ Deprecated
11+
12+
-->
13+
14+
# Changelog
15+
16+
All notable changes to the `numt` project will be documented in this file.
17+
18+
---
19+
20+
## [v0.1.0] - *2025-05-31*
21+
22+
### 🚀 Features and Enhancements
23+
- Initial release of *numt* v0.1.0
24+
25+
### TODO: Update
26+
27+
---

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
egsalamie@gmail.com.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Contributing Guidelines
2+
3+
Thanks for your interest in contributing to numt. Please review these guidelines to ensure a smooth process.
4+
5+
## Make Valuable Contributions
6+
7+
Strive to make **useful**, **creative**, and **high quality** contributions. This isn't meant to be a high bar, but more of a guiding principle and philosophy. Here's what we mean by these terms:
8+
9+
**Useful:** Solve common problems, use cases, bugs, or new features.
10+
11+
**Creative:** Innovative and helping us all grow and learn new things.
12+
13+
**High Quality:** Well-written, structured, and explained.
14+
15+
## Ways to Contribute
16+
17+
To improve and grow the project, we need your help! Here are some ways to get involved:
18+
19+
| Activity | Ideas |
20+
| -------- | ----- |
21+
| 👋 Discussions | Start a discussion by asking a question or making a suggestion. |
22+
| 🐛 Open an Issue | Find unhandled exceptions and bugs in the codebase. |
23+
| 📄 Documentation | Write documentation for the project. |
24+
| 🧪 Testing | Write unit tests to increase code coverage. |
25+
| 🧩 Feature Requests | Brainstorm new ideas such as a CLI option to select any language. |
26+
| 🛠️ Code Contributions | Contribute to the codebase and submit a pull request. |
27+
| 🔢 Code Readability | Find ways to make code more readable and easier to understand. |
28+
| 🤔 Other | Anything else you can think of! |
29+
30+
These are just a few examples, and we welcome any other ideas you may have!
31+
32+
## Submitting Changes
33+
34+
1. Fork the repository and clone it locally.
35+
2. Create a new branch with a descriptive name i.e <code>feature/new-feature-name</code> or <code>bugfix-issue-123</code>.
36+
3. Make focused changes with clear commits.
37+
4. Open a pull request document the changes you've made and why they're necessary.
38+
5. Respond to code reviews from maintainers.
39+
40+
## Code Quality Expectations
41+
42+
- Clear, well-documented code
43+
- Include tests for new code
44+
- Follow project style standards
45+
- Rebase onto latest main branch
46+
47+
## Attribution
48+
49+
Contributors to our project will be acknowledged in the project's README.md file.
50+
51+
## License
52+
53+
By contributing to our project, you agree to license your contributions under the project's open source license. The project's license can be found in the [LICENSE](https://github.com/ajithvcoder/numt/blob/main/LICENSE)
54+
55+
Thank you for your interest in contributing to numt! We appreciate your help and look forward to working with you.
56+
57+
---

0 commit comments

Comments
 (0)