Skip to content

Commit

Permalink
Get Main into the branch (#19)
Browse files Browse the repository at this point in the history
* Fix Samedec bug

When this was written, SAMEDEC development was slow and on 0.2.3, and we didn't estimate a 3.0 launch then.

Changed the string to check for 0.1.X, instead of 0.2.X, meaning that
anything greater than V1 will work.

Needs compatibility checking with V3.

* Create Runner (#6)

* Create Runner

This is Github runner that will be used for testing when ready.

* Update and rename python-app.yml to main_runner.yml

Added Flake8 as a dependency for the runner

Renamed runner

* Fix Flake8 execution

Let's get it right this time, hopefully.

* Flake8 is being annoying.

Come on man, just work please.

* Create CODEOWNERS

Actually allow me to do checks  properly

* Add Contribution Tutorial (#12)

* Add Contribution Tutorial

* Update CONTRIBUTING.md

---------

Co-authored-by: Reggie Torres <[email protected]>
  • Loading branch information
A-c0rN and reggietorres authored Feb 3, 2024
1 parent 97f8ccd commit d4da8dd
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 10 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/main_runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Dependancies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: python3-pip python3-pyaudio ffmpeg curl git
version: 1.0
- name: Install Python Requirements
run: |
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi
python3 -m pip install flake8
- name: Install SAMEDEC Decoder
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y --profile default
git clone https://github.com/cbs228/sameold.git
cd sameold
cargo install --path crates/samedec
source $HOME/.cargo/env
cd ..
rm -rf sameold
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
python3 -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
python3 -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# TODO: Wrtie Pytest files
# - name: Test with pytest
# run: |
# pytest
- name: Check ASMARA Version
run: python3 asmara.py -V
# TODO: Make a new config exit after startup due to no inputs/outputs
# - name: Run ASMARA
# run: python3 asmara.py -d
- name: 'Cleanup build folder'
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @A-c0rN
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing Guidelines

Thank you for considering contributing to our project! We appreciate your efforts to improve our codebase. Please follow these guidelines to ensure smooth collaboration and efficient handling of pull requests.

## Pull Request Process

1. **Fork the Repository**: If you haven't already, fork the repository to your GitHub account.

2. **Create a Branch**: Create a new branch for your feature or bug fix. Use a descriptive name that reflects the purpose of your changes.

3. **Make Changes**: Make your changes to the codebase. Ensure that your modifications adhere to the project's coding standards and guidelines.

4. **Test Your Changes**: Before submitting a pull request, test your changes locally to ensure they function as expected. If applicable, write tests to cover your code changes.

5. **Commit Your Changes**: Commit your changes with clear and concise commit messages. Include details about what you have changed and why, Include in-depth documentation on changes both in the commits and in the pull requests, including any relevant context or reasoning.

```bash
git add .
git commit -m "Descriptive commit message"
```
6. **Push Your Changes**: Once you are satisfied with your changes, push your branch to your forked repository.
```bash
git push origin <your-branch-name>
```
7. **Submit a Pull Request**: Go to the original repository (upstream) and create a pull request from your forked branch. Include in-depth documentation on changes both in the commits and in the pull requests, including any relevant context or reasoning.
8. **Review Process**: After submitting your pull request, a project maintainer will review your changes. Be responsive to any feedback or requests for revisions.
9. **Address Feedback**: If requested changes are needed, make the necessary updates to your branch and push the changes. Your pull request will be re-evaluated after the updates.
10. Merge: Once your pull request is approved and all checks pass, it will be merged into the main branch, Congratulations on your contribution!
20 changes: 10 additions & 10 deletions asmara.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,28 +243,28 @@ def __decoder__(self):
sev=severity.trace,
)
try:
if (
"samedec 0.2."
if not (
"samedec 0.1."
in Popen(["samedec", "-V"], stdout=PIPE)
.communicate()[0]
.decode("UTF-8")
.strip()
):
self.__decode__ = Popen(
["samedec", "-r", "24000"],
stdout=PIPE,
stdin=PIPE,
stderr=PIPE,
bufsize=1,
)
else:
utilities.autoPrint(
text=f"SAMEDEC is not version 0.2 or higher! Recommended version is 0.2.3.",
classType="DECODER",
sev=severity.fatal,
)
AS_MAN.killAsmara()
exit(1)
else:
self.__decode__ = Popen(
["samedec", "-r", "24000"],
stdout=PIPE,
stdin=PIPE,
stderr=PIPE,
bufsize=1,
)
except FileNotFoundError:
utilities.autoPrint(
text=f"Samedec is not installed on the computer. Please install SAMEDEC 0.2.3 or higher.",
Expand Down

0 comments on commit d4da8dd

Please sign in to comment.