-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ancientjpeg/add-pytest
Add pytest
- Loading branch information
Showing
5 changed files
with
112 additions
and
1 deletion.
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,34 @@ | ||
name: Test And Lint Using Conda | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Install dependencies | ||
run: | | ||
conda env update --file environment.yml --name base | ||
- name: Lint with flake8 | ||
run: | | ||
conda install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
conda install pytest | ||
pytest |
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,51 @@ | ||
name: playlistr | ||
channels: | ||
- defaults | ||
dependencies: | ||
- aiohttp=3.9.3 | ||
- aiosignal=1.2.0 | ||
- attrs=23.1.0 | ||
- black=23.11.0 | ||
- brotli-python=1.0.9 | ||
- bzip2=1.0.8 | ||
- ca-certificates=2023.12.12 | ||
- certifi=2024.2.2 | ||
- cffi=1.16.0 | ||
- charset-normalizer=2.0.4 | ||
- click=8.1.7 | ||
- cryptography=41.0.7 | ||
- debugpy=1.6.7 | ||
- expat=2.5.0 | ||
- frozenlist=1.4.0 | ||
- idna=3.4 | ||
- iniconfig=1.1.1 | ||
- libcxx=14.0.6 | ||
- libffi=3.4.4 | ||
- multidict=6.0.4 | ||
- mypy_extensions=1.0.0 | ||
- ncurses=6.4 | ||
- openssl=3.0.13 | ||
- packaging=23.1 | ||
- pathspec=0.10.3 | ||
- pip=23.3.1 | ||
- platformdirs=3.10.0 | ||
- pluggy=1.0.0 | ||
- pycparser=2.21 | ||
- pyjwt=2.4.0 | ||
- pyopenssl=23.2.0 | ||
- pysocks=1.7.1 | ||
- pytest=7.4.0 | ||
- python=3.12.1 | ||
- readline=8.2 | ||
- requests=2.31.0 | ||
- setuptools=68.2.2 | ||
- sqlite=3.41.2 | ||
- tk=8.6.12 | ||
- tzdata=2023d | ||
- urllib3=1.26.18 | ||
- wheel=0.41.2 | ||
- xz=5.4.5 | ||
- yarl=1.9.3 | ||
- zlib=1.2.13 | ||
- pip: | ||
- oauthlib==3.2.2 |
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,18 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "playlistr" | ||
description = "A streaming service migration CLI tool." | ||
dynamic = ["version"] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = [ | ||
"--import-mode=importlib", | ||
] | ||
pythonpath = [ | ||
"src" | ||
] | ||
|
||
[tool.hatch] |
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,8 @@ | ||
from playlistr.service import Service | ||
from playlistr.spotify import Spotify | ||
from playlistr.apple_music import AppleMusic | ||
|
||
|
||
def test_typing(): | ||
assert issubclass(Spotify, Service) | ||
assert issubclass(AppleMusic, Service) |