diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..79e654e --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = True +omit = + */opr/__main__.py +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + pragma: no cover diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..597ebea --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,130 @@ +# 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 both within project spaces and in public spaces +when an individual is representing the project or its community. +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 +info@pycm.io. +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 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..76ad605 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contribution + +Changes and improvements are more than welcome! ❤️ Feel free to fork and open a pull request. + + +Please consider the following : + + +1. Fork it! +2. Create your feature branch (under `dev` branch) +3. Add your functions/methods to proper files +4. Add standard `docstring` to your functions/methods +5. Add tests for your functions/methods (`doctest` testcases in `test` folder) +6. Pass all CI tests +7. Update `CHANGELOG.md` + - Describe changes under `[Unreleased]` section +8. Submit a pull request into `dev` (please complete the pull request template) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2ed0dc5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,13 @@ +#### Description + +#### Steps/Code to Reproduce + +#### Expected Behavior + +#### Actual Behavior + +#### Operating System + +#### Python Version + +#### OPR Version (Use : `opr.__version__`) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ded12d6 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +#### Reference Issues/PRs + +#### What does this implement/fix? Explain your changes. + +#### Any other comments? + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..811b9c4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: "/" + schedule: + interval: weekly + time: "01:30" + open-pull-requests-limit: 10 + target-branch: dev + assignees: + - "sadrasabouri" diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 0000000..b1f6776 --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,34 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/*.tar.gz + twine upload dist/*.whl \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3277ce1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,51 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: CI + +on: [push, pull_request] + +env: + TEST_PYTHON_VERSION: 3.9 + TEST_OS: 'ubuntu-20.04' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, windows-latest, macOS-latest] + python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0, 3.12.0] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Installation + run: | + python -m pip install --upgrade pip + pip install . + - name: Test requirements Installation + run: | + python otherfiles/requirements-splitter.py + pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt + - name: Test with pytest + run: | + python -m pytest . --cov=opr --cov-report=term + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: false + if: matrix.python-version == env.TEST_PYTHON_VERSION && matrix.os == env.TEST_OS + - name: Vulture, Bandit and Pydocstyle tests + run: | + python -m vulture opr/ otherfiles/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size + python -m bandit -r opr -s B311 + python -m pydocstyle -v + if: matrix.python-version == env.TEST_PYTHON_VERSION + - name: Version check + run: | + python otherfiles/version_check.py + if: matrix.python-version == env.TEST_PYTHON_VERSION diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b811a9e --- /dev/null +++ b/.gitignore @@ -0,0 +1,100 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +.venv/ +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject +### Example user template template +### Example user template + +# IntelliJ project files +.idea +*.iml +out +gen diff --git a/.pydocstyle b/.pydocstyle new file mode 100644 index 0000000..a57a2a4 --- /dev/null +++ b/.pydocstyle @@ -0,0 +1,4 @@ +[pydocstyle] +match_dir = ^(?!(tests|build)).* +match = .*\.py + diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..259c460 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,10 @@ +# Authors # + +---------- +- Sadra Sabouri - Open Science Laboratory ([Github](https://github.com/sadrasabouri)) ** + +** **Maintainer** + +# Other Contributors # +---------- + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e264388 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added +### Changed + +[Unreleased]: https://github.com/openscilab/opr/compare/v0.1...dev +[0.1]: https://github.com/openscilab/opr/compare/3598e8b...v0.1 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c5e8c61 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 OpenSciLab + +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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..bce073c --- /dev/null +++ b/README.md @@ -0,0 +1,111 @@ +
+ +---------- + +## Table of contents + +* [Overview](https://github.com/openscilab/opr#overview) +* [Installation](https://github.com/openscilab/opr#installation) +* [Usage](https://github.com/openscilab/opr#usage) +* [Issues & Bug Reports](https://github.com/openscilab/opr#issues--bug-reports) +* [Todo](https://github.com/openscilab/opr/blob/main/TODO.md) +* [Contribution](https://github.com/openscilab/opr/blob/main/.github/CONTRIBUTING.md) +* [Authors](https://github.com/openscilab/opr/blob/main/AUTHORS.md) +* [License](https://github.com/openscilab/opr/blob/main/LICENSE) +* [Show Your Support](https://github.com/openscilab/opr#show-your-support) +* [Changelog](https://github.com/openscilab/opr/blob/main/CHANGELOG.md) +* [Code of Conduct](https://github.com/openscilab/opr/blob/main/.github/CODE_OF_CONDUCT.md) + + +## Overview ++OPR is an open source Python package that provides ... TODO +
+PyPI Counter | +
+
+ |
+
Github Stars | +
+
+ |
+
Branch | +main | +dev | +
CI | +
+ |
+
+ |
+