Skip to content

Commit

Permalink
Merge pull request #33 from tefra/fix-32
Browse files Browse the repository at this point in the history
Fix google app flow
  • Loading branch information
tefra committed May 8, 2022
2 parents d8e8d5d + 4312bdb commit e50961c
Show file tree
Hide file tree
Showing 65 changed files with 969 additions and 927 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on:
release:
types: [released]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
include:
- {name: Python 3.6, python: 3.6, os: ubuntu}
- {name: Python 3.7, python: 3.7, os: ubuntu}
- {name: Python 3.8, python: 3.8, os: ubuntu}
- {name: Python 3.9, python: 3.9, os: ubuntu}
- {name: Python 3.10, python: "3.10", os: ubuntu}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox codecov
- name: Test
run: |
tox -e py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
pre-commit:
name: Pre-commit Hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.2
53 changes: 29 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.4
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: seed-isort-config
args: ['--exclude=docs/*']
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.1.0
hooks:
- id: isort
- id: reorder-python-imports
- repo: https://github.com/ambv/black
rev: 19.10b0
rev: 22.3.0
hooks:
- id: black
args: ['--line-length=79']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [
flake8-bugbear,
flake8-annotations,
flake8-comprehensions,
]
args: ["--suppress-none-returning"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: pretty-format-json
args: ['--autofix', '--indent=4']
- id: fix-encoding-pragma
args: ['--remove']
- repo: git@github.com:humitos/mirrors-autoflake.git
rev: v1.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
- repo: git@github.com:humitos/mirrors-docformatter.git
rev: v1.0
hooks:
- id: docformatter
args: ['--in-place', '--pre-summary-newline']
args: ["--in-place", "--pre-summary-newline"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
rev: v0.950
hooks:
- id: mypy
additional_dependencies: [tokenize-rt]
additional_dependencies: [tokenize-rt, types-setuptools, types-requests, types-tabulate]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.6.0
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
args: ["--max-py-version=3.10"]
- repo: https://github.com/PyCQA/doc8
rev: 0.11.1
hooks:
- id: doc8
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

13 changes: 8 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pytuber
.. image:: https://img.shields.io/github/languages/top/tefra/pytuber.svg
:target: https://pytuber.readthedocs.io/

.. image:: https://api.codacy.com/project/badge/Grade/5d21d2a3c7fd4dc5883c48124cac44de
:target: https://app.codacy.com/app/tefra/pytuber?utm_source=github.com&utm_medium=referral&utm_content=tefra/pytuber&utm_campaign=Badge_Grade_Dashboard
.. image:: https://app.codacy.com/project/badge/Grade/00744926e0c94552857f3320640c7f71
:target: https://www.codacy.com/gh/tefra/pytuber/dashboard?utm_source=github.com&utm_medium=referral&utm_content=tefra/pytuber&utm_campaign=Badge_Grade

.. image:: https://img.shields.io/pypi/pyversions/pytuber.svg
:target: https://pypi.org/pypi/pytuber/
Expand Down Expand Up @@ -69,13 +69,16 @@ pytuber includes a quota calculator
$ pytuber quota
Additionally to the api quota limit Youtube limits the amount of how many playlists you can create per day to only **10**.
Additionally to the api quota limit Youtube limits the amount of how many
playlists you can create per day to only **10**.

In case you reach that number, you can push a new playlist manually.
- Create a playlist with `pytuber add` command
- View the playlist by using this command `pytuber show xxxx --mime`
- This mime string is base64 signature used by pytuber internally to link local to youtube playlists
- Add a youtube playlists manually from the web site and add the mime signature at the bottom of the playlist description
- This mime string is base64 signature used by pytuber internally to
link local to youtube playlists
- Add a youtube playlists manually from the web site and add the mime
signature at the bottom of the playlist description
- Fetch the new playlist info `pytuber fetch youtube --playlists`

Afterwards you will be aple to push tracks like normally.
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down
29 changes: 20 additions & 9 deletions docs/credentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,33 @@ Youtube:

**Enable APIs for your project**

Any application that calls Google APIs needs to enable those APIs in the API Console. To enable the appropriate APIs for your project:
Any application that calls Google APIs needs to enable those APIs in
the API Console. To enable the appropriate APIs for your project:

1. Open the `Library page <https://console.developers.google.com/apis/library>`_ in the API Console.
2. Select the project associated with your application. Create a project if you do not have one already.
3. Use the Library page to find each API that your application will use. Click on each API and enable it for your project.
1. Open the `Library page <https://console.developers.google.com/apis/library>`_
in the API Console.
2. Select the project associated with your application. Create a project if you
do not have one already.
3. Use the Library page to find each API that your application will use.
Click on each API and enable it for your project.

**Create authorization credentials**

Any application that uses OAuth 2.0 to access Google APIs must have authorization credentials that identify the application to Google's OAuth 2.0 server. The following steps explain how to create credentials for your project. Your applications can then use the credentials to access APIs that you have enabled for that project.
Any application that uses OAuth 2.0 to access Google APIs must have
authorization credentials that identify the application to Google's
OAuth 2.0 server. The following steps explain how to create credentials
for your project. Your applications can then use the credentials to
access APIs that you have enabled for that project.

1. Open the `Credentials page <https://console.developers.google.com/apis/credentials/>`_. in the API Console.
1. Open the `Credentials page <https://console.developers.google.com/apis/credentials/>`_.
in the API Console.
2. Click Create credentials > OAuth client ID.
3. Complete the form. Set the application type to **other**.
3. Complete the form. Set the application type to **Desktop APP**.

.. image:: /_static/google.console.png

Download your ``client_secret.json`` and assuming the file is on your user downloads directory run and follow the on screen instructions
Download your ``client_secret.json`` and assuming the file is on your user
downloads directory run and follow the on screen instructions


.. code-block:: console
Expand All @@ -34,7 +44,8 @@ Download your ``client_secret.json`` and assuming the file is on your user downl
Last.fm
-------

Apply for a last.fm `api key <https://www.last.fm/api/account/create>`_ write down your key **key** and run from terminal
Apply for a last.fm `api key <https://www.last.fm/api/account/create>`_
write down your key **key** and run from terminal

.. code-block:: console
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/add_editor.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
add editor
----------

This information was generated by running ``pytuber add editor --help`` from the command line.
This information was generated by running ``pytuber add editor --help``
from the command line.

.. program-output:: pytuber add editor --help

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/add_file.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
add file
--------

This information was generated by running ``pytuber add file --help`` from the command line.
This information was generated by running ``pytuber add file --help``
from the command line.

.. program-output:: pytuber add file --help

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/add_lastfm.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
add lastfm
----------

This information was generated by running ``pytuber add lastfm --help`` from the command line.
This information was generated by running ``pytuber add lastfm --help``
from the command line.

.. program-output:: pytuber add lastfm --help
3 changes: 2 additions & 1 deletion docs/reference/clean.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clean
-----

This information was generated by running ``pytuber clean --help`` from the command line.
This information was generated by running ``pytuber clean --help`` from
the command line.

.. program-output:: pytuber clean --help
3 changes: 2 additions & 1 deletion docs/reference/fetch_lastfm.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
fetch lastfm
------------

This information was generated by running ``pytuber fetch lastfm --help`` from the command line.
This information was generated by running ``pytuber fetch lastfm --help``
from the command line.

.. program-output:: pytuber fetch lastfm --help
3 changes: 2 additions & 1 deletion docs/reference/fetch_youtube.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
fetch youtube
-------------

This information was generated by running ``pytuber fetch youtube --help`` from the command line.
This information was generated by running ``pytuber fetch youtube --help``
from the command line.

.. program-output:: pytuber fetch youtube --help
3 changes: 2 additions & 1 deletion docs/reference/list.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
list
----

This information was generated by running ``pytuber list --help`` from the command line.
This information was generated by running ``pytuber list --help`` from the
command line.

.. program-output:: pytuber list --help

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/overview.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Overview
--------

This information was generated by running ``pytuber --help`` from the command line.
This information was generated by running ``pytuber --help`` from the
command line.

.. program-output:: pytuber --help
3 changes: 2 additions & 1 deletion docs/reference/push_youtube.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
push youtube
------------

This information was generated by running ``pytuber push youtube --help`` from the command line.
This information was generated by running ``pytuber push youtube --help``
from the command line.

.. program-output:: pytuber push youtube --help
3 changes: 2 additions & 1 deletion docs/reference/quota.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
quota
-----

This information was generated by running ``pytuber quota --help`` from the command line.
This information was generated by running ``pytuber quota --help``
from the command line.

.. program-output:: pytuber quota --help

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/remove.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
remove
------

This information was generated by running ``pytuber remove --help`` from the command line.
This information was generated by running ``pytuber remove --help``
from the command line.

.. program-output:: pytuber remove --help
3 changes: 2 additions & 1 deletion docs/reference/setup.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
setup
-----

This information was generated by running ``pytuber setup --help`` from the command line.
This information was generated by running ``pytuber setup --help``
from the command line.

.. program-output:: pytuber setup --help

0 comments on commit e50961c

Please sign in to comment.