Skip to content

Commit

Permalink
feat: test grouping, chore: bump FFmpeg, refactor: everything, test: …
Browse files Browse the repository at this point in the history
…linting (#3)

* feat: workflows, health, group tests, bump FFmpeg, lint, StyleCI, cleanup

* style: fix StyleCI config

* style: fix StyleCI config

* style: StyleCI python support is paid

* test: fixing linter runner

* test: linting runner fixes

* fix README

* remove references to StyleCI in contributing

* version bump
  • Loading branch information
paranarimasu authored Apr 12, 2021
1 parent 184b81c commit 8bec394
Show file tree
Hide file tree
Showing 17 changed files with 855 additions and 265 deletions.
85 changes: 85 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## Assignment

Unless otherwise specified, any issue that does not have an assignee can be claimed by any volunteer.

Leave a comment in the issue indicating interest so that the assignee can be designated by a member. This is a requirement in Github to allow assignment of contributors outside of the organization by members.

If further discussion is needed before work can be started, please make use of the `#design` channel on the discord.

## Development Environment

Follow the [Installation Guide](/AnimeThemes/animethemes-webm-verifier/blob/main/README.md#install) to ensure a functional local instance of the AnimeThemes WebM Verifier forked from this repository.

Set this repository as upstream to the forked repository.

`git remote add upstream https://github.com/AnimeThemes/animethemes-webm-verifier.git`

Pull upstream changes so that the local main branch is even with the upstream main branch.

`git pull upstream main`

Push upstream changes to the forked remote main branch if needed.

`git push`

## Feature Branch Workflow

Once the main branch is even with upstream, create a new feature branch from the main branch. The new feature branch name should be descriptive.

`git branch new-feature-branch`

Switch to the new feature branch.

`git checkout new-feature-branch`

Make changes in the new feature branch. Once completed, run the linter.

`pylint test_webm`

Stage changes. Commit changes. Please include ticket ID's and use [Semantic Commit Messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716).

## Cleanup Before Pull Request

Fetch the upstream main branch and merge with the fork repo's main branch.
```
git fetch upstream main
git checkout main
git merge upstream/main
```

If there were any new commits, rebase the new feature branch.
```
git checkout new-feature-branch
git rebase main
```

## Pull Request

Push changes to remote.

`git push --set-upstream origin new-feature-branch`

Create Pull Request from the new feature branch to the upstream main branch.

## Pruning

Once the Pull Request is merged, delete the feature branch locally.

`git branch -d new-feature-branch`

Delete the remote feature branch.

`git push origin --delete new-feature-branch`

Pull upstream changes so that the fork main branch is even with upstream.

`git pull upstream main`

Push upstream changes to the fork's remote if needed.

`git push`

## References

* [Semantic Commit Messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716)
* [Github Forking](https://gist.github.com/Chaser324/ce0505fbed06b947d962)
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: AnimeThemes
open_collective: # Replace with a single Open Collective username
ko_fi: animethemes
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
22 changes: 22 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pylint

on: [push]

jobs:
pylint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Run pylint
run: |
pylint test_webm
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
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/*
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,7 @@ dmypy.json
# JetBrains IDEs
.idea

# End of https://www.toptal.com/developers/gitignore/api/python
# End of https://www.toptal.com/developers/gitignore/api/python

# Test Files
*.webm
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, 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.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## 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 a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 paranarimasu
Copyright (c) AnimeThemes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,30 @@ Test success/failure does **NOT** guarantee acceptance/rejection of submissions.

### Usage

python -m test_webm [-h] [--loglevel [{debug,info,error}] [file [file ...]]
test_webm [-h] [--loglevel [{debug,info,error}]] [--groups [{format,video,audio} ...]] [file ...]

* `--loglevel error`: Only show error messages
* `--loglevel info`: Show error messages and script progression info messages
* `--loglevel debug`: Show all messages, including variable dumps
* `[file ...]`: The WebM(s) to verify. If not provided, we will test all WebMs in the current directory.
**File**

The WebM(s) to verify. If not provided, we will test all WebMs in the current directory.

**Groups**

The groups of tests that should be run.

The `format` group pertains to testing of the file format and context of streams.

The `video` group pertains to testing of the video stream of the file.

The `audio` group pertains to testing of the audio stream of the file.

By default, all test groups will be included.

**Logging**

Determines the level of the logging for the program.

`--loglevel error` will only output error messages.

`--loglevel info` will output error messages and script progression info messages.

`--loglevel debug` will output all messages, including variable dumps.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

setup(
name='animethemes-webm-verifier',
version='1.0',
author='paranarimasu',
author_email='[email protected]',
version='1.1',
author='AnimeThemes',
author_email='[email protected]',
url='https://github.com/AnimeThemes/animethemes-webm-verifier',
description='Verify WebM(s) Against AnimeThemes Encoding Standards',
long_description=long_description,
Expand Down
Loading

0 comments on commit 8bec394

Please sign in to comment.