-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul tooling, linting, editor configs, and README
- Loading branch information
1 parent
49315ec
commit ba83e29
Showing
13 changed files
with
609 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{feature,json,md,yaml,yml,toml}] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
exclude: '_pb2.pyi?$' | ||
repos: | ||
- repo: https://github.com/mtkennerly/pre-commit-hooks | ||
rev: v0.3.0 | ||
hooks: | ||
- id: poetry-ruff | ||
- id: poetry-mypy | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.11.5 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"recommendations": [ | ||
"EditorConfig.EditorConfig", | ||
"streetsidesoftware.code-spell-checker", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"charliermarsh.ruff", | ||
"ms-python.isort", | ||
"ms-python.mypy-type-checker", | ||
"redhat.vscode-yaml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Development | ||
|
||
This project is managed using [Poetry](https://python-poetry.org), a fantastic Python packaging and dependency manager. | ||
Install the latest version of Poetry before continuing. Development currently requires Python 3.7+. | ||
|
||
## Set up | ||
|
||
Starting from Zero? Not sure where to begin? Here's steps on setting up this Python project using Poetry. Note that | ||
Poetry installation instructions should be followed from the Poetry Docs: https://python-poetry.org/docs/#installation | ||
|
||
1. While optional, It's recommended to configure Poetry to install Virtual environments within project folders: | ||
```shell | ||
poetry config virtualenvs.in-project true | ||
``` | ||
This makes it easier for Visual Studio Code to detect the Virtual Environment, as well as other IDEs and systems. | ||
I've also had issues with Poetry creating duplicate Virtual environments in the default folder for an unknown | ||
reason which quickly filled up my System storage. | ||
2. Clone the Repository: | ||
```shell | ||
git clone https://github.com/rlaphoenix/pywidevine | ||
cd pywidevine | ||
``` | ||
3. Install the Project with Poetry: | ||
```shell | ||
poetry install | ||
``` | ||
This creates a Virtual environment and then installs all project dependencies and executables into the Virtual | ||
environment. Your System Python environment is not affected at all. | ||
4. Now activate the Virtual environment: | ||
```shell | ||
poetry shell | ||
``` | ||
Note: | ||
- You can alternatively just prefix `poetry run` to any command you wish to run under the Virtual environment. | ||
- I recommend entering the Virtual environment and all further instructions will have assumed you did. | ||
- JetBrains PyCharm has integrated support for Poetry and automatically enters Poetry Virtual environments, assuming | ||
the Python Interpreter on the bottom right is set up correctly. | ||
- For more information, see: https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment | ||
5. Install Pre-commit tooling to ensure safe and quality commits: | ||
```shell | ||
pre-commit install | ||
``` | ||
## Building Source and Wheel distributions | ||
poetry build | ||
You can optionally specify `-f` to build `sdist` or `wheel` only. | ||
Built files can be found in the `/dist` directory. |
Oops, something went wrong.