Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version #2

Merged
merged 9 commits into from
May 11, 2024
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
89 changes: 89 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Bump version
on:
pull_request:
types:
- closed

jobs:
test:
if: github.event.pull_request.merged == true
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
include:
- name: 'check'
python: '3.9'
toxpython: 'python3.9'
os: 'ubuntu-latest'
- name: 'py39 (ubuntu)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
os: 'ubuntu-latest'
- name: 'py39 (windows)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
os: 'windows-latest'
- name: 'py39 (macos)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'arm64'
os: 'macos-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: poetry install --with dev
- name: Run tests
run: poetry run pytest

bump_version_and_publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: poetry install --with dev
- name: Bump version and push tag
if: success() # Only continue if all was successful till now
uses: anothrNick/github-tag-action@1.67.0
env:
GITHUB_TOKEN: ${{ secrets.lib-ml-tag-bump-token }}
DEFAULT_BUMP: patch
TAG_CONTEXT: branch
WITH_V: false
PRERELEASE: false
- name: Update files with new version
if: success() # Only continue if tagging was successful
run: poetry run bump-my-version replace --config-file pyproject.toml --new-version $(git describe --tags --abbrev=0)
- name: Build and publish to PyPI
if: success() # Only continue if version in files was updated
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --build -r testpypi -u __token__ -p ${{ secrets.PYPI_TEST_ACCOUNT }} --name


75 changes: 75 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
*.py[cod]
__pycache__

# Temp files
.*.sw[po]
*~
*.bak
.DS_Store

# C extensions
*.so

# Build and package files
*.egg
*.egg-info
.bootstrap
.build
.cache
.eggs
.env
.installed.cfg
.ve
bin
build
develop-eggs
dist
eggs
lib
lib64
parts
pip-wheel-metadata/
pyvenv*/
sdist
var
venv*/
.venv*/
wheelhouse

# Installer logs
pip-log.txt

# Unit test / coverage reports
.benchmarks
.coverage
.coverage.*
.pytest
.pytest_cache/
.tox
coverage.xml
htmlcov
nosetests.xml

# Translations
*.mo

# Buildout
.mr.developer.cfg

# IDE project files
*.iml
*.komodoproject
.idea
.project
.pydevproject
.vscode

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build

# Mypy Cache
.mypy_cache/
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2024, Shayan Ramezani

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 (including the next paragraph) 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.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
# lib-ml
# package_template_tester

<div align="center">

<!-- [![Build status](https://github.com/test/package_template_tester/workflows/build/badge.svg?branch=master&event=push)](https://github.com/test/package_template_tester/actions?query=workflow%3Abuild)
[![Python Version](https://img.shields.io/pypi/pyversions/package_template_tester.svg)](https://pypi.org/project/package_template_tester/)
[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/test/package_template_tester/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Security: bandit](https://img.shields.io/badge/security-bandit-green.svg)](https://github.com/PyCQA/bandit)
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/test/package_template_tester/blob/master/.pre-commit-config.yaml)
[![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/test/package_template_tester/releases)
[![License](https://img.shields.io/github/license/test/package_template_tester)](https://github.com/test/package_template_tester/blob/master/LICENSE)
![Coverage Report](assets/images/coverage.svg) -->


</div>

## Installation
Inside your virtual environment run:

```bash
poetry add package_template_tester
```

or install with `pip`

```bash
pip install package_template_tester
```

Now you can import the library inside python modules

```python
from lib_ml_remla import preprocess_data, split_data
```

## 🛡 License

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

This project is licensed under the terms of the `MIT` license. See [LICENSE](https://github.com/remla24-team10/lib-ml/blob/main/LICENSE) for more details.
Loading
Loading