diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..57efb02 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: 'bug' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Code with explanation +2. How to run code +3. The error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. Linux] + - Package versions implicated in the error (torch, mdlearn versions, etc) + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ac2e8b4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..a1e43a6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/other.md b/.github/ISSUE_TEMPLATE/other.md new file mode 100644 index 0000000..f4fe6e8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other.md @@ -0,0 +1,10 @@ +--- +name: Other issue template +about: Any issue that does not fit the other templates +title: '' +labels: '' +assignees: '' + +--- + +**Description** diff --git a/.github/ISSUE_TEMPLATE/question-issue-template.md b/.github/ISSUE_TEMPLATE/question-issue-template.md new file mode 100644 index 0000000..34bebe5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question-issue-template.md @@ -0,0 +1,10 @@ +--- +name: Question issue template +about: Ask a question about how to use mdlearn +title: '' +labels: question +assignees: '' + +--- + +**Describe the question** diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..4d9a5b4 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,15 @@ +name: Pre-Commit Checks + +on: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout code + - uses: actions/setup-python@v3 + name: Setup Python + - uses: pre-commit/action@v3.0.0 + name: Run Pre-Commit Checks diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..815acd5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,22 @@ +name: Pytest Unit Tests + +on: [push] + +jobs: + build_and_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout code + - name: Set up Python 3.9 + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Setup PDM + uses: pdm-project/setup-pdm@v3 + with: + python-version: 3.9 + - name: Build the Project + run: make init build + - name: Test with pytest + run: make test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c0e685 --- /dev/null +++ b/.gitignore @@ -0,0 +1,300 @@ +# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,visualstudiocode,macos,linux,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks,visualstudiocode,macos,linux,windows + +### JupyterNotebooks ### +# gitignore template for Jupyter Notebooks +# website: http://jupyter.org/ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +# IPython +profile_default/ +ipython_config.py + +# Remove previous ipynb_checkpoints +# git rm -r .ipynb_checkpoints/ + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# 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/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +docs/build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook + +# IPython + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### VisualStudioCode ### +.vscode/ +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Vim +*.swp + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +.vscode/*.code-snippets + +# Ignore code-workspaces +*.code-workspace + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,visualstudiocode,macos,linux,windows + +# Ignore logs folder that is created if user does not specify +logs/ + +# Environment file for Docker Compose +.env + +# ignore redis dump file +*.rdb + +# Image Artifacts +**/*.jpg + +# PDM +.pdm-python +.pdm-build/* + +# Ruff +.ruff_cache/* + +test_experiment/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b136a5a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-toml + - id: check-ast + - id: check-merge-conflict + - id: check-added-large-files + - id: mixed-line-ending + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.3.2 + hooks: + # Run the linter. + - id: ruff + args: [--fix] + # Run the formatter. + - id: ruff-format +exclude: 'docs/build/.*|docs/source/pages/_autosummary/.*' diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..bce6070 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# 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, 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 within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +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 +kyle.hippe@gmail.com. +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.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6dbbaba --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,93 @@ +# Contributing to qsui + +If you are interested in contributing to qsui, your contributions will fall into two categories: + +1. You want to implement a new feature: + - In general, we accept any features as long as they fit the scope of this package. If you are unsure about this or need help on the design/implementation of your feature, post about it in an issue. +2. You want to fix a bug: + - Please post an issue using the Bug template which provides a clear and concise description of what the bug was. + +Once you finish implementing a feature or bug-fix, please send a Pull Request to https://github.com/ravescovi/qsui. + +## Developing qsui + +To develop qsui on your machine, please follow these instructions: + +1. Clone a copy of qsui from source: + +``` +git clone https://github.com/ravescovi/qsui.git +cd qsui +``` + +2. If you already have qsui from source, update it: + +``` +git pull +``` + +3. Install qsui in `develop` mode: + +``` +conda create -n rpl-qsui python=3.9 +conda activate rpl-qsui +pip3 install --upgrade pip setuptools wheel +pip3 install -r requirements/dev.txt +pip3 install -r requirements/requirements.txt +pip3 install -e . +``` + +This mode will symlink the Python files from the current local source tree into the Python install. +Hence, if you modify a Python file, you do not need to reinstall qsui again and again. + +4. Ensure that you have a working `qsui` installation by running: + +``` +python3 -c "import qsui; print(qsui.__version__)" +``` + +5. To run dev tools (isort, flake8, black): + +``` +make +``` + +## Unit Testing + +To run the test suite: + +1. [Build and install](#developing-qsui) qsui from source. +2. The `requirements/dev.txt` contains the additional testing dependencies. +3. Run the test suite: `pytest test -vs` + +If contributing, please add a `test_.py` in the `test/` directory +in a subdirectory that matches the qsui package directory structure. Inside, +`test_.py` implement test functions using pytest. + +## Building Documentation + +To build the documentation: + +1. [Build and install](#developing-qsui) qsui from source. +2. The `requirements/dev.txt` contains all the dependencies needed to build the documentation. +3. Generate the documentation file via: +``` +cd qsui/docs +make html +``` +The docs are located in `qsui/docs/build/html/index.html`. + +To view the docs run: `open qsui/docs/build/html/index.html`. + +## Releasing to PyPI + +To release a new version of qsui to PyPI: + +1. Merge the `develop` branch into the `main` branch with an updated version number in [`qsui.__init__`](https://github.com/ravescovi/qsui/blob/main/qsui/__init__.py). +2. Make a new release on GitHub with the tag and name equal to the version number. +3. [Build and install](#developing-qsui) qsui from source. +4. Run the following commands: +``` +python3 setup.py sdist +twine upload dist/* +``` diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..258bd62 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Argonne National Laboratory Rapid Prototyping Lab + +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. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..546b79e --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +################################################################################ +# QSUI Makefile +################################################################################ + +checks: # Runs all the pre-commit checks + @pre-commit install + @pre-commit run --all-files || { echo "Checking fixes\n" ; pre-commit run --all-files; } + +build: build-python # Builds the project + +################ +# Python Rules # +################ + +# (Make sure you've installed PDM) + +init-python: pdm.lock deps # Installs the python environment (requires PDM) + +build-python: init-python # Builds the pypi package for APP_NAME + pdm build + +############################### +# Python Dependency Managment # +############################### + +pdm.lock: pyproject.toml # Generates the pdm.lock file + pdm install --group :all + +requirements/*.txt: pdm.lock + pdm export --without-hashes --group :all -o requirements/requirements.txt + +.PHONY += deps +deps: requirements/*.txt # Generates the requirements files for APP_NAME + pdm install --group :all diff --git a/README.md b/README.md new file mode 100644 index 0000000..f471894 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# QSUI + + + + + +For more details and specific examples of how to use QSUI, please see our [documentation](???). + +## Table of Contents +- [QSUI](#QSUI) + - [Table of Contents](#table-of-contents) + - [Usage](#usage) + - [Installation](#installation) + - [Development](#development) + - [Contributing](#contributing) + - [Acknowledgments](#acknowledgments) + - [License](#license) + +## Usage + +To get started with QSUI, we recommend: + +- Consulting the [Documentation](??) + +## Installation + + +## Development + + + +### Using PDM + +- [Managing Dependencies](https://pdm-project.org/latest/usage/dependency/) +- [Build and Publish](https://pdm-project.org/latest/usage/publish/) +- [Running Using PDM](https://pdm-project.org/latest/usage/scripts/) + +### Using Pre-commit + +- To run pre-commit checks before committing, run `pre-commit run --all-files` +- NONE OF THE FOLLOWING SHOULD BE DONE REGULARLY, AND ALL CHECKS SHOULD BE PASSING BEFORE BRANCHES ARE MERGED + - To skip linting during commits, use `SKIP=ruff git commit ...` + - To skip formatting during commits, use `SKIP=ruff-format git commit ...` + - To skip all pre-commit hooks, use `git commit --no-verify ...` +- See [pre-commit documentation](https://pre-commit.com) for more + +### Building Documentation + +- You can install the documentation python dependencies with `pip install -e '.[docs]'` or `pdm install -G docs` +- You must install [Graphviz](https://graphviz.org/download/) +- You can build the docs with `make docs` + +## Contributing + +Please report **bugs**, **enhancement requests**, or **questions** through the [Issue Tracker](https://github.com/ravescovi/qsui). + +If you are looking to contribute, please see [`CONTRIBUTING.md`](https://github.com/ravescovi/qsuo/blob/main/CONTRIBUTING.md). + + +## Citing + +```bibtex +``` + +## License + +QSUI is MIT licensed, as seen in the [LICENSE](./LICENSE) file. diff --git a/pdm.lock b/pdm.lock new file mode 100644 index 0000000..3e85e17 --- /dev/null +++ b/pdm.lock @@ -0,0 +1,51 @@ +# This file is @generated by PDM. +# It is not intended for manual editing. + +[metadata] +groups = ["default"] +strategy = ["cross_platform", "inherit_metadata"] +lock_version = "4.4.1" +content_hash = "sha256:9a6527a7c1549e3895201684d98a1f88c5a3cebdae79dcf4504fa6c9c2b09879" + +[[package]] +name = "pyqt5" +version = "5.15.10" +requires_python = ">=3.7" +summary = "Python bindings for the Qt cross platform application toolkit" +groups = ["default"] +dependencies = [ + "PyQt5-Qt5>=5.15.2", + "PyQt5-sip<13,>=12.13", +] +files = [ + {file = "PyQt5-5.15.10-cp37-abi3-macosx_10_13_x86_64.whl", hash = "sha256:93288d62ebd47b1933d80c27f5d43c7c435307b84d480af689cef2474e87e4c8"}, + {file = "PyQt5-5.15.10-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:862cea3be95b4b0a2b9678003b3a18edf7bd5eafd673860f58820f246d4bf616"}, + {file = "PyQt5-5.15.10-cp37-abi3-manylinux_2_17_x86_64.whl", hash = "sha256:b89478d16d4118664ff58ed609e0a804d002703c9420118de7e4e70fa1cb5486"}, + {file = "PyQt5-5.15.10-cp37-abi3-win32.whl", hash = "sha256:ff99b4f91aa8eb60510d5889faad07116d3340041916e46c07d519f7cad344e1"}, + {file = "PyQt5-5.15.10-cp37-abi3-win_amd64.whl", hash = "sha256:501355f327e9a2c38db0428e1a236d25ebcb99304cd6e668c05d1188d514adec"}, + {file = "PyQt5-5.15.10.tar.gz", hash = "sha256:d46b7804b1b10a4ff91753f8113e5b5580d2b4462f3226288e2d84497334898a"}, +] + +[[package]] +name = "pyqt5-qt5" +version = "5.15.14" +summary = "The subset of a Qt installation needed by PyQt5." +groups = ["default"] +files = [ + {file = "PyQt5_Qt5-5.15.14-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:c89b35b2aaf24d2805cc76fe31880c77b7f7557db8aafb26f1015f1bba7031d6"}, + {file = "PyQt5_Qt5-5.15.14-py3-none-macosx_11_0_arm64.whl", hash = "sha256:730da7e6a97f6bad1b6df21082fe625647730418bc83e20cbc2ff6401ed0a8be"}, +] + +[[package]] +name = "pyqt5-sip" +version = "12.13.0" +requires_python = ">=3.7" +summary = "The sip module support for PyQt5" +groups = ["default"] +files = [ + {file = "PyQt5_sip-12.13.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:7fe3375b508c5bc657d73b9896bba8a768791f1f426c68053311b046bcebdddf"}, + {file = "PyQt5_sip-12.13.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:773731b1b5ab1a7cf5621249f2379c95e3d2905e9bd96ff3611b119586daa876"}, + {file = "PyQt5_sip-12.13.0-cp312-cp312-win32.whl", hash = "sha256:fb4a5271fa3f6bc2feb303269a837a95a6d8dd16be553aa40e530de7fb81bfdf"}, + {file = "PyQt5_sip-12.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:3a4498f3b1b15f43f5d12963accdce0fd652b0bcaae6baf8008663365827444c"}, + {file = "PyQt5_sip-12.13.0.tar.gz", hash = "sha256:7f321daf84b9c9dbca61b80e1ef37bdaffc0e93312edae2cd7da25b953971d91"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..744babb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,137 @@ +[project] +name = "qsui" +version = "0.1.0" +description = "Default template for PDM package" +authors = [ + {name = "Ollivier Gassant", email = "Gassant@anl.gov"}, + {name = "Rafael Vescovi", email = "ravescovi@anl.gov"}, + {name = "Rafael Vescovi", email = "ravescovi@gmail.com"}, +] +requires-python = "==3.12.*" +readme = "README.md" +license = {text = "MIT"} +dependencies = [ + 'pyqt5>5.15', +] + +[project.urls] +Homepage = "https://github.com/ravescovi/qsui" +Downloads = "https://github.com/ravescovi/qsui" + +###################### +# Build Info + Tools # +###################### + +[tool.setuptools.packages.find] +where = ["."] +include = ["qsui*"] +exclude = ["*tests*"] + +##################### +# Development Tools # +##################### + +[tool.ruff] +# https://docs.astral.sh/ruff/configuration/ + +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", + "docs", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.12 +target-version = "py312" + +[tool.ruff.lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +select = [ + # pycodestyle + "E", + # Pyflakes + "F", + # pyupgrade + # "UP", + # flake8-bugbear + "B", + # flake8-simplify + # "SIM", + # isort + "I", + # Warning + "W", + # pydocstyle + "D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", + # ruff + # "RUF" +] +ignore = [ + "E501" # Line too long +] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +[tool.pytest.ini_options] +# https://docs.pytest.org/en/stable/customize.html +addopts = "-x --ignore-glob=**/test_module/*" +junit_family="xunit1" +filterwarnings = [ + "ignore::DeprecationWarning", + "ignore::pottery.exceptions.InefficientAccessWarning", +] + +[tool.mypy] +# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml +show_error_codes = true +check_untyped_defs = true +follow_imports = "normal" +strict_optional = true +plugins = ["pydantic.mypy"] +strict = true +disallow_untyped_defs = true +implicit_reexport = true + +[tool.pdm] +distribution = false diff --git a/requirements/requirements.txt b/requirements/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/qsui/__init__.py b/src/qsui/__init__.py new file mode 100644 index 0000000..8c412bd --- /dev/null +++ b/src/qsui/__init__.py @@ -0,0 +1,5 @@ +"""aaaa""" + +__version__ = ( + "0.0.1" # extract_version(Path(__file__).parent.parent / "pyproject.toml") +) diff --git a/src/qsui/test1.py b/src/qsui/test1.py new file mode 100644 index 0000000..ccba88e --- /dev/null +++ b/src/qsui/test1.py @@ -0,0 +1,23 @@ +"""REWRITE""" + +import sys + +from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow + + +def main(): + """REWRITE""" + app = QApplication(sys.argv) + win = QMainWindow() + win.setGeometry(200, 200, 300, 300) + win.setWindowTitle("My first window!") + + label = QLabel(win) + label.setText("my first label") + label.move(50, 50) + + win.show() + sys.exit(app.exec_()) + + +main() diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..210a3da --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Pytest tests for QSUI"""