sorry for the mess, the python documentation about packaging really aint that great. If someone who is good with python packaging intents to help and open an issue, that would be great

This commit is contained in:
Lars Noack 2022-11-28 17:18:26 +01:00
parent ad50eca2c6
commit aca563d013
9 changed files with 168 additions and 6 deletions

View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.10 (music-downloader)" jdkType="Python SDK" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="rythmbox-id3-lyrics-support" /> <orderEntry type="module" module-name="rythmbox-id3-lyrics-support" />
</component> </component>

View File

@ -1,13 +1,24 @@
# https://packaging.python.org/en/latest/tutorials/packaging-projects/ # https://packaging.python.org/en/latest/tutorials/packaging-projects/
echo "building............" #echo "building............"
#echo "python3 -m pip install --upgrade build"
# python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build python3 -m pip install --upgrade build
#echo "python3 -m build"
python3 -m build python3 -m build
# python3 setup.py sdist bdist_wheel
# python3 setup.py install --user
echo "python3 -m pip install dist/music_kraken-1.2.2-py3-none-any.whl --user --force-reinstall"
python3 -m pip install dist/music_kraken-1.2.2.tar.gz --user --force-reinstall
music-kraken
open /home/lars/.local/lib/python3.10/site-packages/music_kraken
echo "uploading............" echo "uploading............"
python3 -m pip install --upgrade twine #python3 -m pip install --upgrade twine
#twine upload dist/music_kraken* #twine upload dist/music_kraken*
twine upload --repository testpypi dist/music_kraken* # twine upload --repository testpypi dist/music_kraken*
exit exit
echo "pushing............" echo "pushing............"

View File

@ -34,5 +34,9 @@ setup(
"beautifulsoup4~=4.11.1", "beautifulsoup4~=4.11.1",
"pycountry~=22.3.5" "pycountry~=22.3.5"
], ],
entry_points={'console_scripts': ['music-kraken = music_kraken:cli']} entry_points={'console_scripts': ['music-kraken = music_kraken:cli']},
include_package_data=False,
data_files=[
('music_kraken', ['database_structure.sql'])
]
) )

View File

@ -346,4 +346,4 @@ For the lyrics source the page [https://genius.com/](https://genius.com/) is eas
[i2]: https://github.com/HeIIow2/music-downloader/issues/2 [i2]: https://github.com/HeIIow2/music-downloader/issues/2
[mb]: musicbrainz.org/ [mb]: https://musicbrainz.org/

View File

@ -1,7 +1,9 @@
LICENSE LICENSE
README.md README.md
database_structure.sql
pyproject.toml pyproject.toml
setup.py setup.py
assets/temp_database_structure.sql
src/music_kraken/__init__.py src/music_kraken/__init__.py
src/music_kraken/__main__.py src/music_kraken/__main__.py
src/music_kraken.egg-info/PKG-INFO src/music_kraken.egg-info/PKG-INFO
@ -19,8 +21,12 @@ src/music_kraken/audio_source/sources/musify.py
src/music_kraken/audio_source/sources/source.py src/music_kraken/audio_source/sources/source.py
src/music_kraken/audio_source/sources/youtube.py src/music_kraken/audio_source/sources/youtube.py
src/music_kraken/database/__init__.py src/music_kraken/database/__init__.py
src/music_kraken/database/artist.py
src/music_kraken/database/database.py src/music_kraken/database/database.py
src/music_kraken/database/metadata.py
src/music_kraken/database/song.py src/music_kraken/database/song.py
src/music_kraken/database/source.py
src/music_kraken/database/target.py
src/music_kraken/database/temp_database.py src/music_kraken/database/temp_database.py
src/music_kraken/lyrics/__init__.py src/music_kraken/lyrics/__init__.py
src/music_kraken/lyrics/genius.py src/music_kraken/lyrics/genius.py
@ -28,6 +34,7 @@ src/music_kraken/lyrics/lyrics.py
src/music_kraken/metadata/__init__.py src/music_kraken/metadata/__init__.py
src/music_kraken/metadata/metadata_fetch.py src/music_kraken/metadata/metadata_fetch.py
src/music_kraken/metadata/metadata_search.py src/music_kraken/metadata/metadata_search.py
src/music_kraken/static_files/temp_database_structure.sql
src/music_kraken/tagging/__init__.py src/music_kraken/tagging/__init__.py
src/music_kraken/tagging/song.py src/music_kraken/tagging/song.py
src/music_kraken/target/__init__.py src/music_kraken/target/__init__.py

View File

@ -19,6 +19,14 @@ from .utils.shared import (
from .lyrics import lyrics from .lyrics import lyrics
# try reading a static file:
print("TEST")
import pkgutil
data = pkgutil.get_data(__name__, "temp_database_structure.sql")
print(data)
""" """
At the start I modify the garbage collector to run a bit fewer times. At the start I modify the garbage collector to run a bit fewer times.
This should increase speed: This should increase speed:

View File

@ -0,0 +1,66 @@
DROP TABLE IF EXISTS artist;
CREATE TABLE artist (
id TEXT PRIMARY KEY NOT NULL,
name TEXT
);
DROP TABLE IF EXISTS artist_release_group;
CREATE TABLE artist_release_group (
artist_id TEXT NOT NULL,
release_group_id TEXT NOT NULL
);
DROP TABLE IF EXISTS artist_track;
CREATE TABLE artist_track (
artist_id TEXT NOT NULL,
track_id TEXT NOT NULL
);
DROP TABLE IF EXISTS release_group;
CREATE TABLE release_group (
id TEXT PRIMARY KEY NOT NULL,
albumartist TEXT,
albumsort INT,
musicbrainz_albumtype TEXT,
compilation TEXT,
album_artist_id TEXT
);
DROP TABLE IF EXISTS release_;
CREATE TABLE release_ (
id TEXT PRIMARY KEY NOT NULL,
release_group_id TEXT NOT NULL,
title TEXT,
copyright TEXT,
album_status TEXT,
language TEXT,
year TEXT,
date TEXT,
country TEXT,
barcode TEXT
);
DROP TABLE IF EXISTS track;
CREATE TABLE track (
id TEXT PRIMARY KEY NOT NULL,
downloaded BOOLEAN NOT NULL DEFAULT 0,
release_id TEXT NOT NULL,
track TEXT,
length INT,
tracknumber TEXT,
isrc TEXT,
genre TEXT,
lyrics TEXT,
path TEXT,
file TEXT,
url TEXT,
src TEXT
);
DROP TABLE IF EXISTS source;
CREATE TABLE source (
track_id TEXT NOT NULL,
src TEXT NOT NULL,
url TEXT NOT NULL,
valid BOOLEAN NOT NULL DEFAULT 1
);

View File

@ -0,0 +1,66 @@
DROP TABLE IF EXISTS artist;
CREATE TABLE artist (
id TEXT PRIMARY KEY NOT NULL,
name TEXT
);
DROP TABLE IF EXISTS artist_release_group;
CREATE TABLE artist_release_group (
artist_id TEXT NOT NULL,
release_group_id TEXT NOT NULL
);
DROP TABLE IF EXISTS artist_track;
CREATE TABLE artist_track (
artist_id TEXT NOT NULL,
track_id TEXT NOT NULL
);
DROP TABLE IF EXISTS release_group;
CREATE TABLE release_group (
id TEXT PRIMARY KEY NOT NULL,
albumartist TEXT,
albumsort INT,
musicbrainz_albumtype TEXT,
compilation TEXT,
album_artist_id TEXT
);
DROP TABLE IF EXISTS release_;
CREATE TABLE release_ (
id TEXT PRIMARY KEY NOT NULL,
release_group_id TEXT NOT NULL,
title TEXT,
copyright TEXT,
album_status TEXT,
language TEXT,
year TEXT,
date TEXT,
country TEXT,
barcode TEXT
);
DROP TABLE IF EXISTS track;
CREATE TABLE track (
id TEXT PRIMARY KEY NOT NULL,
downloaded BOOLEAN NOT NULL DEFAULT 0,
release_id TEXT NOT NULL,
track TEXT,
length INT,
tracknumber TEXT,
isrc TEXT,
genre TEXT,
lyrics TEXT,
path TEXT,
file TEXT,
url TEXT,
src TEXT
);
DROP TABLE IF EXISTS source;
CREATE TABLE source (
track_id TEXT NOT NULL,
src TEXT NOT NULL,
url TEXT NOT NULL,
valid BOOLEAN NOT NULL DEFAULT 1
);