From 0baa8dd2f5741cc94e13b37fa29b23504dcbb23a Mon Sep 17 00:00:00 2001 From: AHReccese Date: Wed, 31 Jan 2024 11:31:18 +0330 Subject: [PATCH] initialize standard python library --- .coveragerc | 8 ++ .github/CODE_OF_CONDUCT.md | 130 ++++++++++++++++++++++++++++ .github/CONTRIBUTING.md | 17 ++++ .github/ISSUE_TEMPLATE.md | 13 +++ .github/PULL_REQUEST_TEMPLATE.md | 6 ++ .github/dependabot.yml | 11 +++ .github/workflows/publish_pypi.yml | 34 ++++++++ .github/workflows/test.yml | 51 +++++++++++ .gitignore | 100 +++++++++++++++++++++ .pydocstyle | 4 + AUTHORS.md | 10 +++ CHANGELOG.md | 12 +++ LICENSE | 21 +++++ README.md | 111 ++++++++++++++++++++++++ TODO.md | 2 + autopep8.bat | 3 + autopep8.sh | 4 + codecov.yml | 14 +++ dev-requirements.txt | 0 opr/__init__.py | 5 ++ opr/opr_param.py | 3 + otherfiles/RELEASE.md | 38 ++++++++ otherfiles/donation.png | Bin 0 -> 8186 bytes otherfiles/meta.yaml | 34 ++++++++ otherfiles/requirements-splitter.py | 12 +++ otherfiles/version_check.py | 69 +++++++++++++++ requirements.txt | 0 setup.py | 74 ++++++++++++++++ 28 files changed, 786 insertions(+) create mode 100644 .coveragerc create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/publish_pypi.yml create mode 100644 .github/workflows/test.yml create mode 100644 .gitignore create mode 100644 .pydocstyle create mode 100644 AUTHORS.md create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 TODO.md create mode 100644 autopep8.bat create mode 100644 autopep8.sh create mode 100644 codecov.yml create mode 100644 dev-requirements.txt create mode 100644 opr/__init__.py create mode 100644 opr/opr_param.py create mode 100644 otherfiles/RELEASE.md create mode 100644 otherfiles/donation.png create mode 100644 otherfiles/meta.yaml create mode 100644 otherfiles/requirements-splitter.py create mode 100644 otherfiles/version_check.py create mode 100644 requirements.txt create mode 100644 setup.py 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 @@ +
+ +
+
+ + Codecov + + + PyPI version + + + built with Python3 + + + Discord Channel + +
+ +---------- + +## 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 + + + +
+ + + + + + + + + + + +
Branchmaindev
CI + + + +
+ + +## Installation + +### PyPI + +- Check [Python Packaging User Guide](https://packaging.python.org/installing/) +- Run `pip install opr==0.1` +### Source code +- Download [Version 0.1](https://github.com/openscilab/opr/archive/v0.1.zip) or [Latest Source](https://github.com/openscilab/opr/archive/dev.zip) +- Run `pip install .` + +## Usage + +## Issues & bug reports + +Just fill an issue and describe it. We'll check it ASAP! or send an email to [info@openscilab.com](mailto:info@openscilab.com "info@openscilab.com"). + +- Please complete the issue template + +You can also join our discord server + + + Discord Channel + + + +## Show Your Support + + +### Star this repo + +Give a ⭐️ if this project helped you! + +### Donate to our project +If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) . + +OPR Donation \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..c9ee449 --- /dev/null +++ b/TODO.md @@ -0,0 +1,2 @@ +## Todo +- \ No newline at end of file diff --git a/autopep8.bat b/autopep8.bat new file mode 100644 index 0000000..d253b68 --- /dev/null +++ b/autopep8.bat @@ -0,0 +1,3 @@ +python -m autopep8 opr --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 +python -m autopep8 otherfiles --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 +python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose diff --git a/autopep8.sh b/autopep8.sh new file mode 100644 index 0000000..34db904 --- /dev/null +++ b/autopep8.sh @@ -0,0 +1,4 @@ +#!/bin/sh +python -m autopep8 opr --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 +python -m autopep8 otherfiles --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose --ignore=E721 +python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..600c260 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: up + range: "70...100" + status: + patch: + default: + enabled: no + project: + default: + threshold: 1% diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/opr/__init__.py b/opr/__init__.py new file mode 100644 index 0000000..bf8b4f5 --- /dev/null +++ b/opr/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +"""OPR modules.""" +from .opr_param import OPR_VERSION + +__version__ = OPR_VERSION diff --git a/opr/opr_param.py b/opr/opr_param.py new file mode 100644 index 0000000..eb2786c --- /dev/null +++ b/opr/opr_param.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +"""Parameters and constants.""" +OPR_VERSION = "0.1" diff --git a/otherfiles/RELEASE.md b/otherfiles/RELEASE.md new file mode 100644 index 0000000..42377ea --- /dev/null +++ b/otherfiles/RELEASE.md @@ -0,0 +1,38 @@ +# OPR Release Instructions + +#### Last Update: 2023-12-20 + +1. Create the `release` branch under `dev` +2. Update all version tags + 1. `setup.py` + 2. `README.md` + 3. `otherfiles/version_check.py` + 4. `otherfiles/meta.yaml` + 5. `opr/opr_param.py` +3. Update `CHANGELOG.md` + 1. Add a new header under `Unreleased` section (Example: `## [0.1] - 2022-08-17`) + 2. Add a new compare link to the end of the file (Example: `[0.2]: https://github.com/openscilab/opr/compare/v0.1...v0.2`) + 3. Update `dev` compare link (Example: `[Unreleased]: https://github.com/openscilab/opr/compare/v0.2...dev`) +4. Create a PR from `release` to `dev` + 1. Title: `Version x.x` (Example: `Version 0.1`) + 2. Tag all related issues + 3. Labels: `release` + 4. Set milestone + 5. Wait for all CI pass + 6. Need review (**2** reviewers) + 7. Squash and merge + 8. Delete `release` branch +5. Merge `dev` branch into `main` + 1. `git checkout main` + 2. `git merge dev` + 3. `git push origin main` + 4. Wait for all CI pass +6. Create a new release + 1. Target branch: `main` + 2. Tag: `vx.x` (Example: `v0.1`) + 3. Title: `Version x.x` (Example: `Version 0.1`) + 4. Copy changelogs + 5. Tag all related issues +7. Bump!! +8. Close this version issues +9. Close milestone \ No newline at end of file diff --git a/otherfiles/donation.png b/otherfiles/donation.png new file mode 100644 index 0000000000000000000000000000000000000000..c1c2e50183ce06a96c6f1dd330c68a68ea487acf GIT binary patch literal 8186 zcmbVxbx>Ph&^Ati5?o6{X(`2vONu+e9g0J7hu{>~wgf0pT!RIQ6)4c)ZbgF@mlE8i z6xuhx@BRCm`R3c1d(Y0ZyU*_3d(N3V_ata*Dw7g35@TUuk*caF=we~v05N*gBV5dV z%)LDfGZ1;InD}5}kx>43VNb7w-eX~5?`f;+D=K@cW9eLpKZ4Q!R~Q)? zF#tC=H$6Q)CnqO4IXN2}8!<8QvuDphAP_q{JH`#8V-!p*#)NUhIAat{AO?K;^y%Zr zk1afBs-N|CjCN=H~bB-xn7b7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R+0Y$I+mEz literal 0 HcmV?d00001 diff --git a/otherfiles/meta.yaml b/otherfiles/meta.yaml new file mode 100644 index 0000000..1c24999 --- /dev/null +++ b/otherfiles/meta.yaml @@ -0,0 +1,34 @@ +{% set name = "opr" %} +{% set version = "0.1" %} + +package: + name: {{ name|lower }} + version: {{ version }} +source: + git_url: https://github.com/openscilab/opr + git_rev: v{{ version }} +build: + noarch: python + number: 0 + script: {{ PYTHON }} -m pip install . -vv +requirements: + host: + - pip + - setuptools + - python >=3.6 + run: + - python >=3.6 +about: + home: https://github.com/openscilab/opr + license: MIT + license_family: MIT + summary: Python library for machine learning input and output + description: | + OPR is an open source Python package that provides... TODO + + Website: https://openscilab.com + + Repo: https://github.com/openscilab/opr +extra: + recipe-maintainers: + - sadrasabouri diff --git a/otherfiles/requirements-splitter.py b/otherfiles/requirements-splitter.py new file mode 100644 index 0000000..4d095bb --- /dev/null +++ b/otherfiles/requirements-splitter.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +"""Requirements splitter.""" + +test_req = "" + +with open('dev-requirements.txt', 'r') as f: + for line in f: + if '==' not in line: + test_req += line + +with open('test-requirements.txt', 'w') as f: + f.write(test_req) diff --git a/otherfiles/version_check.py b/otherfiles/version_check.py new file mode 100644 index 0000000..7db8069 --- /dev/null +++ b/otherfiles/version_check.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +"""Version-check script.""" +import os +import sys +import codecs +Failed = 0 +OPR_VERSION = "0.1" + + +SETUP_ITEMS = [ + "version='{0}'", + 'https://github.com/openscilab/opr/tarball/v{0}'] +README_ITEMS = [ + "[Version {0}](https://github.com/openscilab/opr/archive/v{0}.zip)", + "pip install opr=={0}"] +CHANGELOG_ITEMS = [ + "## [{0}]", + "https://github.com/openscilab/opr/compare/v{0}...dev", + "[{0}]:"] +PARAMS_ITEMS = ['OPR_VERSION = "{0}"'] +META_ITEMS = ['% set version = "{0}" %'] + +FILES = { + os.path.join("otherfiles", "meta.yaml"): META_ITEMS, + "setup.py": SETUP_ITEMS, + "README.md": README_ITEMS, + "CHANGELOG.md": CHANGELOG_ITEMS, + os.path.join("opr", "opr_param.py"): PARAMS_ITEMS, +} + +TEST_NUMBER = len(FILES) + + +def print_result(failed=False): + """ + Print final result. + + :param failed: failed flag + :type failed: bool + :return: None + """ + message = "Version tag tests " + if not failed: + print("\n" + message + "passed!") + else: + print("\n" + message + "failed!") + print("Passed : " + str(TEST_NUMBER - Failed) + "/" + str(TEST_NUMBER)) + + +if __name__ == "__main__": + for file_name in FILES: + try: + file_content = codecs.open( + file_name, "r", "utf-8", 'ignore').read() + for test_item in FILES[file_name]: + if file_content.find(test_item.format(OPR_VERSION)) == -1: + print("Incorrect version tag in " + file_name) + Failed += 1 + break + except Exception as e: + Failed += 1 + print("Error in " + file_name + "\n" + "Message : " + str(e)) + + if Failed == 0: + print_result(False) + sys.exit(0) + else: + print_result(True) + sys.exit(1) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5d78e96 --- /dev/null +++ b/setup.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +"""Setup module.""" +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + + +def get_requires(): + """Read requirements.txt.""" + requirements = open("requirements.txt", "r").read() + return list(filter(lambda x: x != "", requirements.split())) + + +def read_description(): + """Read README.md and CHANGELOG.md.""" + try: + with open("README.md") as r: + description = "\n" + description += r.read() + with open("CHANGELOG.md") as c: + description += "\n" + description += c.read() + return description + except Exception: + return '''TODO''' + + +setup( + name='opr', + packages=[ + 'opr',], + version='0.1', + description='TODO', + long_description=read_description(), + long_description_content_type='text/markdown', + author='OPR Development Team', + author_email='info@pycm.io', + url='https://github.com/openscilab/opr', + download_url='https://github.com/openscilab/opr/tarball/v0.1', + keywords="python3 python machine_learning ML", + project_urls={ + 'Source': 'https://github.com/openscilab/opr', + }, + install_requires=get_requires(), + python_requires='>=3.6', + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Manufacturing', + 'Intended Audience :: Science/Research', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'Topic :: Education', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Scientific/Engineering :: Physics', + ], + license='MIT', +)