Skip to content

Commit 36c36cb

Browse files
author
unknown
committed
added CI/CD automation and workflows
1 parent ec629ab commit 36c36cb

File tree

13 files changed

+818
-146
lines changed

13 files changed

+818
-146
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. Windows 11, macOS Sonoma]
28+
- Python Version [e.g. 3.10]
29+
- App Version [e.g. 2.4.0]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Pull Request
3+
about: Propose a change to the codebase
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
12+
13+
Fixes # (issue)
14+
15+
**Type of change**
16+
Please delete options that are not relevant.
17+
- [ ] Bug fix (non-breaking change which fixes an issue)
18+
- [ ] New feature (non-breaking change which adds functionality)
19+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20+
- [ ] This change requires a documentation update
21+
22+
**How Has This Been Tested?**
23+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
24+
25+
- [ ] Test A
26+
- [ ] Test B
27+
28+
**Checklist:**
29+
- [ ] My code follows the style guidelines of this project
30+
- [ ] I have performed a self-review of my own code
31+
- [ ] I have commented my code, particularly in hard-to-understand areas
32+
- [ ] I have made corresponding changes to the documentation
33+
- [ ] My changes generate no new warnings
34+
- [ ] I have added tests that prove my fix is effective or that my feature works
35+
- [ ] New and existing unit tests pass locally with my changes
36+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
python-version: ["3.8", "3.9", "3.10", "3.11"]
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Cache pip dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cache/pip
33+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
34+
restore-keys: |
35+
${{ runner.os }}-pip-
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
pip install flake8 pytest
42+
43+
- name: Check formatting with Black
44+
run: |
45+
pip install black
46+
black --check .
47+
48+
- name: Lint with flake8
49+
run: |
50+
# stop the build if there are Python syntax errors or undefined names
51+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
52+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
53+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
54+
55+
- name: Install GUI dependencies on Linux
56+
if: runner.os == 'Linux'
57+
run: |
58+
sudo apt-get update
59+
sudo apt-get install -y xvfb qt6-base-dev libqt6gui6
60+
61+
- name: Run tests on Linux
62+
if: runner.os == 'Linux'
63+
run: xvfb-run pytest
64+
65+
- name: Run tests on Windows and macOS
66+
if: runner.os != 'Linux'
67+
run: pytest
68+
69+
build:
70+
name: Build Package
71+
needs: test
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- name: Checkout repository
76+
uses: actions/checkout@v4
77+
78+
- name: Set up Python
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: '3.10'
82+
83+
- name: Install build tools
84+
run: |
85+
python -m pip install --upgrade pip
86+
pip install build
87+
88+
- name: Build package
89+
run: python -m build

CODE_OF_CONDUCT.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that are contributive to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards and
42+
will take appropriate and fair corrective action in response to any behavior that
43+
they deem inappropriate, threatening,offensive, or harmful.
44+
45+
Community leaders have the right and responsibility to remove, edit, or reject
46+
comments, commits, code, wiki edits, issues, and other contributions that are
47+
not aligned to this Code of Conduct, and will communicate reasons for moderation
48+
decisions when appropriate.
49+
50+
## Scope
51+
52+
This Code of Conduct applies within all community spaces, and also applies when
53+
an individual is officially representing the community in public spaces.
54+
Examples of representing our community include using an official e-mail address,
55+
posting via an official social media account, or acting as an appointed
56+
representative at an online or offline event.
57+
58+
## Enforcement
59+
60+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
61+
reported to the community leaders responsible for enforcement at
62+
ukr.projects@gmail.com.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series
85+
of actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interaction in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or
92+
permanent ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within
112+
the community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.1, available at
118+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
119+
120+
[homepage]: https://www.contributor-covenant.org
121+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing to sharpify-gui
2+
3+
Thank you for your interest in contributing! We welcome bug reports, feature requests, and pull requests.
4+
5+
## Code of Conduct
6+
7+
This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
8+
9+
## How to Contribute
10+
11+
There are many ways to contribute, from writing code and documentation to reporting bugs.
12+
13+
### Reporting Bugs and Requesting Features
14+
15+
The best way to report a bug or request a new feature is to [open an issue](https://github.com/ukr-projects/sharpify-gui/issues). Please use the provided templates to ensure you include all the necessary information.
16+
17+
### Contributing Code
18+
19+
If you'd like to contribute code, please follow these steps:
20+
21+
**1. Set Up Your Environment**
22+
23+
```bash
24+
# Fork the repository on GitHub, then clone your fork
25+
git clone https://github.com/ukr-projects/sharpify-gui.git
26+
cd sharpify-gui
27+
28+
# Create and activate a virtual environment
29+
python -m venv venv
30+
# On Windows: venv\Scripts\activate
31+
# On macOS/Linux: source venv/bin/activate
32+
33+
# Install dependencies
34+
pip install -r requirements.txt
35+
pip install pytest black flake8
36+
```
37+
38+
**2. Make Your Changes**
39+
40+
* Create a new branch for your changes: `git checkout -b feature/my-new-feature`
41+
* Write your code.
42+
* Format your code automatically by running: `black .`
43+
44+
**3. Submit a Pull Request**
45+
46+
* Push your branch to your fork on GitHub.
47+
* [Open a pull request](https://github.com/ukr-projects/sharpify-gui/pulls) to the `main` branch.
48+
* Fill out the pull request template to explain your changes.
49+
50+
The project maintainers will review your pull request, provide feedback, and merge it if it meets the contribution guidelines. Thank you for your contribution!

pyproject.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sharpify-gui"
7+
version = "2.0.0"
8+
authors = [
9+
{ name="ukr-projects", email="ukr.projects@gmail.com" }
10+
]
11+
description = "A desktop GUI for the Real-ESRGAN image and video upscaler."
12+
readme = "README.md"
13+
requires-python = ">=3.8"
14+
license = { file = "LICENSE" }
15+
classifiers = [
16+
"Programming Language :: Python :: 3",
17+
"License :: OSI Approved :: MIT License",
18+
"Operating System :: OS Independent",
19+
"Framework :: PyQt",
20+
"Topic :: Multimedia :: Graphics :: Editors"
21+
]
22+
dependencies = [
23+
"PyQt6>=6.6.0,<7.0.0"
24+
]
25+
26+
[project.urls]
27+
"Homepage" = "https://github.com/ukr-projects/sharpify-gui"
28+
"Bug Tracker" = "https://github.com/ukr-projects/sharpify-gui/issues"
29+
30+
[tool.setuptools.packages.find]
31+
where = ["src"]

0 commit comments

Comments
 (0)