generated from habedi/template-python-library
-
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 4b2155d
Showing
20 changed files
with
909 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,16 @@ | ||
[run] | ||
# Exclude test files and specific init files from the coverage report | ||
omit = | ||
*/tests/* | ||
*/test_*.py | ||
*/__init__.py # Good idea to exclude __init__.py files from the coverage report | ||
|
||
# Include source files only from certain directories | ||
source = | ||
src/ | ||
|
||
# Set parallel to true if you run tests in parallel | ||
parallel = True | ||
|
||
# Enable branch coverage if set to True | ||
branch = 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,29 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# Top-most EditorConfig file | ||
root = true | ||
|
||
# Global settings (applicable to all files unless overridden) | ||
[*] | ||
charset = utf-8 # Default character encoding | ||
end_of_line = lf # Use LF for line endings (Unix-style) | ||
indent_style = space # Use spaces for indentation | ||
indent_size = 4 # Default indentation size | ||
insert_final_newline = true # Make sure files end with a newline | ||
trim_trailing_whitespace = true # Remove trailing whitespace | ||
|
||
# Python specific settings, complying with PEP 8 style guide, except for the line length | ||
[*.py] | ||
max_line_length = 100 # Limit lines to 100 characters | ||
|
||
# Markdown files | ||
[*.md] | ||
trim_trailing_whitespace = false # Don't remove trailing whitespace in Markdown files | ||
# Bash scripts | ||
[*.sh] | ||
indent_size = 2 | ||
# YAML files | ||
[*.yml] | ||
indent_size = 2 |
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,64 @@ | ||
# Common document and text file formats | ||
*.docx filter=lfs diff=lfs merge=lfs -text | ||
*.doc filter=lfs diff=lfs merge=lfs -text | ||
*.pdf filter=lfs diff=lfs merge=lfs -text | ||
*.xls filter=lfs diff=lfs merge=lfs -text | ||
*.xlsx filter=lfs diff=lfs merge=lfs -text | ||
*.ppt filter=lfs diff=lfs merge=lfs -text | ||
*.pptx filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common image formats | ||
*.jpg filter=lfs diff=lfs merge=lfs -text | ||
*.jpeg filter=lfs diff=lfs merge=lfs -text | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
*.gif filter=lfs diff=lfs merge=lfs -text | ||
*.bmp filter=lfs diff=lfs merge=lfs -text | ||
*.tiff filter=lfs diff=lfs merge=lfs -text | ||
*.tif filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common compressed file formats | ||
*.zip filter=lfs diff=lfs merge=lfs -text | ||
*.gz filter=lfs diff=lfs merge=lfs -text | ||
*.tar filter=lfs diff=lfs merge=lfs -text | ||
*.tgz filter=lfs diff=lfs merge=lfs -text | ||
*.bz2 filter=lfs diff=lfs merge=lfs -text | ||
*.7z filter=lfs diff=lfs merge=lfs -text | ||
*.rar filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common file formats in machine learning projects | ||
*.bin filter=lfs diff=lfs merge=lfs -text | ||
*.model filter=lfs diff=lfs merge=lfs -text | ||
*.h5 filter=lfs diff=lfs merge=lfs -text | ||
*.tfrecord filter=lfs diff=lfs merge=lfs -text | ||
*.hdf5 filter=lfs diff=lfs merge=lfs -text | ||
*.keras filter=lfs diff=lfs merge=lfs -text | ||
*.pth filter=lfs diff=lfs merge=lfs -text | ||
*.pt filter=lfs diff=lfs merge=lfs -text | ||
*.joblib filter=lfs diff=lfs merge=lfs -text | ||
*.pkl filter=lfs diff=lfs merge=lfs -text | ||
*.pickle filter=lfs diff=lfs merge=lfs -text | ||
*.npy filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common audio and video formats | ||
*.mp3 filter=lfs diff=lfs merge=lfs -text | ||
*.mp4 filter=lfs diff=lfs merge=lfs -text | ||
*.wav filter=lfs diff=lfs merge=lfs -text | ||
*.avi filter=lfs diff=lfs merge=lfs -text | ||
*.mov filter=lfs diff=lfs merge=lfs -text | ||
*.flac filter=lfs diff=lfs merge=lfs -text | ||
*.mkv filter=lfs diff=lfs merge=lfs -text | ||
*.webm filter=lfs diff=lfs merge=lfs -text | ||
*.ogg filter=lfs diff=lfs merge=lfs -text | ||
*.ogv filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common data transfer formats | ||
#*.csv filter=lfs diff=lfs merge=lfs -text | ||
#*.tsv filter=lfs diff=lfs merge=lfs -text | ||
#*.json filter=lfs diff=lfs merge=lfs -text | ||
#*.xml filter=lfs diff=lfs merge=lfs -text | ||
*.parquet filter=lfs diff=lfs merge=lfs -text | ||
*.feather filter=lfs diff=lfs merge=lfs -text | ||
*.msgpack filter=lfs diff=lfs merge=lfs -text | ||
*.avro filter=lfs diff=lfs merge=lfs -text | ||
*.arrow filter=lfs diff=lfs merge=lfs -text | ||
*.orc filter=lfs diff=lfs merge=lfs -text |
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,40 @@ | ||
name: Publish to PyPI | ||
|
||
on: | ||
workflow_dispatch: # Enable manual runs | ||
|
||
jobs: | ||
|
||
# Run tests before publishing | ||
call_tests: | ||
uses: ./.github/workflows/tests.yml | ||
|
||
publish_to_pypi: | ||
runs-on: ubuntu-latest | ||
needs: call_tests | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
run: | | ||
pip install poetry | ||
- name: Install Dependencies | ||
run: | | ||
poetry install | ||
# - name: Update Version | ||
# run: | | ||
# poetry version patch # Use 'minor' or 'major' for minor or major version bumps | ||
|
||
- name: Build and Publish Package | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} # Make sure you've set `secrets.PYPI_API_TOKEN` | ||
poetry publish --build |
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,43 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_dispatch: # Only enable manual runs for now | ||
workflow_call: # Make this workflow available to be called by other workflows | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
# Define the Python versions to test against | ||
python-version: [ "3.10", "3.11", "3.12" ] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Install Poetry and Dependencies and run tests with coverage and upload test results and coverage reports as artifacts | ||
- name: Install Poetry and Dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
- name: Run Tests with Coverage | ||
run: | | ||
poetry run pytest tests/ --doctest-modules --cov=src --cov-report xml --cov-report html \ | ||
--junitxml=junit/test-results-${{ matrix.python-version }}.xml | ||
continue-on-error: false | ||
|
||
- name: Upload Test Results and Coverage Reports | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results-and-coverage-${{ matrix.python-version }} | ||
path: | | ||
junit/test-results-${{ matrix.python-version }}.xml | ||
htmlcov/ |
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,75 @@ | ||
# Python specific | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Virtual environments | ||
.env/ | ||
env/ | ||
.venv/ | ||
venv/ | ||
|
||
# Packaging and distribution files | ||
.Python | ||
build/ | ||
dist/ | ||
*.egg-info/ | ||
*.egg | ||
MANIFEST | ||
|
||
# Dependency directories | ||
develop-eggs/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
.installed.cfg | ||
|
||
# Test and coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# IDE specific files and directories | ||
.idea/ | ||
*.iml | ||
.vscode/ | ||
|
||
# Jupyter Notebook files | ||
.ipynb_checkpoints | ||
|
||
# Temporary files created by editors and the system and folders to ignore | ||
*.swp | ||
*~ | ||
*.bak | ||
*.tmp | ||
temp/ | ||
output/ | ||
tmp/ | ||
tmp2/ | ||
out/ | ||
out2/ | ||
|
||
# Database files (SQLite, DuckDB, etc.) | ||
*.duckdb | ||
*.db | ||
*.wal | ||
*.sqlite | ||
|
||
# Dependency lock files (uncomment to ignore) | ||
poetry.lock | ||
|
||
# Miscellaneous files and directories to ignore | ||
# Add any additional file patterns a directory names that should be ignored down here |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Hassan Abedi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.