Verified Commit b61acffa authored by Sumner Evans's avatar Sumner Evans 💬

Use poetry instead of setup.py

parent e0b4cfee
Pipeline #202835823 failed with stages
in 1 minute and 34 seconds
......@@ -24,7 +24,7 @@ tasks:
echo "source $(poetry env info -p)/bin/activate" >> ~/.buildenv
- lint: |
python setup.py check -mrs
poetry check
black --check .
flake8
mypy sublime_music tests/**/*.py
......@@ -36,7 +36,7 @@ tasks:
pytest
- build: |
python setup.py sdist
poetry build
# TODO migrate deploy to sr.ht
# - deploy-pypi: |
......
......@@ -11,7 +11,6 @@ source .venv/bin/activate
watch_file pyproject.toml
watch_file poetry.lock
watch_file setup.py
watch_file shell.nix
unset PS1
......@@ -22,7 +22,7 @@ lint:
before_script:
- ./cicd/install-project-deps.sh
script:
- poetry run python setup.py check -mrs
- poetry check
- poetry run black --check .
- poetry run flake8
- poetry run mypy sublime_music tests/**/*.py
......@@ -47,7 +47,7 @@ build:
before_script:
- ./cicd/install-project-deps.sh
script:
- poetry run python setup.py sdist
- poetry build
artifacts:
paths:
- dist/*
......
v0.11.11-devel
==============
**Infrastructure**
* Convert entirely over to ``poetry`` from ``setuptools`` for building.
* Add a custom check to ensure that the version in ``pyproject.toml`` matches
with the other instances of the version.
v0.11.10
========
......
......@@ -61,9 +61,19 @@ with open(Path("sublime_music/__init__.py")) as f:
if line.startswith("__version__"):
version = eval(line.split()[-1])
break
else: # nobreak
raise AssertionError("No version in sublime_music/__init__.py")
with open(Path("pyproject.toml")) as f:
for line in f:
if line.startswith("version ="):
assert eval(line.split()[-1]) == version, "Version mismatch: pyproject.toml"
break
else: # nobreak
raise AssertionError("No version in pyproject.toml")
with open(Path("CHANGELOG.rst")) as f:
assert f.readline().strip() == f"v{version}", "Version mismatch"
assert f.readline().strip() == f"v{version}", "Version mismatch: CHANGELOG"
sys.exit(0 if valid else 1)
[tool.poetry]
name = "sublime_music"
version = "0.11.10"
version = "0.11.11-devel"
description = "A native GTK *sonic client."
license = "GPL-3.0-or-later"
authors = ["Sumner Evans <inquiries@sumnerevans.com>"]
readme = "README.rst"
homepage = "https://sublimemusic.app"
repository = "https://sr.ht/~sumner/sublime-music"
documentation = "https://sublime-music.gitlab.io/sublime-music/"
keywords = ["airsonic", "music", "chromecast", "subsonic"]
repository = "https://gitlab.com/sublime-music/sublime-music"
documentation = "https://sublime-music.gitlab.io/sublime-music"
keywords = ["airsonic", "music", "GTK", "chromecast", "subsonic"]
classifiers = [
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Environment :: X11 Applications :: GTK",
"Intended Audience :: End Users/Desktop",
"Operating System :: POSIX",
"Topic :: Multimedia :: Sound/Audio :: Players",
]
# TODO
exclude = ["tests"]
exclude = [
"tests",
"sublime_music/adapters/subsonic/api_specs"
]
[tool.poetry.urls]
"Bug Tracker" = "https://todo.sr.ht/~sumner/sublime-music"
"Bug Tracker" = "https://gitlab.com/sublime-music/sublime-music/-/issues"
[tool.poetry.scripts]
sublime-music = 'sublime_music.__main__:main'
......@@ -30,19 +34,19 @@ sublime-music = 'sublime_music.__main__:main'
[tool.poetry.dependencies]
python = "^3.8"
bleach = "^3.2.1"
bottle = {version = "^0.12.18", optional = true}
dataclasses-json = "^0.5.2"
deepdiff = "^5.0.2"
fuzzywuzzy = "^0.18.0"
keyring = {version = "^21.4.0", optional = true}
peewee = "^3.13.3"
pychromecast = {version = "^7.3.0", optional = true}
PyGObject = "^3.38.0"
python-dateutil = "^2.8.1"
python-Levenshtein = "^0.12.0"
python-mpv = "^0.5.2"
requests = "^2.24.0"
semver = "^2.10.2"
bottle = {version = "^0.12.18", optional = true}
keyring = {version = "^21.4.0", optional = true}
pychromecast = {version = "^7.3.0", optional = true}
[tool.poetry.dev-dependencies]
black = "^20.8b1"
......@@ -56,11 +60,11 @@ flake8-pep3101 = "^1.3.0"
flake8-print = "^3.1.4"
mypy = "^0.782"
pytest-cov = "^2.10.1"
termcolor = "^1.1.0"
requirements-parser = "^0.2.0"
rst2html5 = "^1.10.6"
sphinx = "^3.2.1"
sphinx_rtd_theme = "^0.5.0"
rst2html5 = "^1.10.6"
termcolor = "^1.1.0"
[tool.poetry.extras]
chromecast = ["pychromecast"]
......
from pathlib import Path
from setuptools import find_packages, setup
here = Path(__file__).parent.resolve()
with open(here.joinpath("README.rst"), encoding="utf-8") as f:
long_description = f.read()
# Find the version
with open(here.joinpath("sublime_music", "__init__.py")) as f:
for line in f:
if line.startswith("__version__"):
version = eval(line.split()[-1])
break
package_data_dirs = [
here.joinpath("sublime_music", "adapters", "icons"),
here.joinpath("sublime_music", "adapters", "images"),
here.joinpath("sublime_music", "adapters", "subsonic", "icons"),
here.joinpath("sublime_music", "dbus", "mpris_specs"),
here.joinpath("sublime_music", "ui", "icons"),
here.joinpath("sublime_music", "ui", "images"),
]
package_data_files = []
for data_dir in package_data_dirs:
for file in data_dir.iterdir():
package_data_files.append(str(file))
setup(
name="sublime_music",
version=version,
url="https://gitlab.com/sublime-music/sublime-music",
description="A native GTK *sonic client.",
long_description=long_description,
author="Sumner Evans",
author_email="inquiries@sumnerevans.com",
license="GPL3",
classifiers=[
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
# Indicate who your project is intended for
"Intended Audience :: End Users/Desktop",
"Operating System :: POSIX",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 3.8",
],
keywords="airsonic subsonic libresonic gonic music",
packages=find_packages(exclude=["tests"]),
package_data={"sublime_music": ["ui/app_styles.css", *package_data_files]},
install_requires=[
"bleach",
"dataclasses-json",
"deepdiff",
"fuzzywuzzy",
'osxmmkeys ; sys_platform=="darwin"',
"peewee",
"PyGObject",
"python-dateutil",
"python-Levenshtein",
"python-mpv",
"requests",
"semver",
],
extras_require={
"keyring": ["keyring"],
"chromecast": ["pychromecast"],
"server": ["bottle"],
},
# To provide executable scripts, use entry points in preference to the
# "scripts" keyword. Entry points provide cross-platform support and
# allow pip to create the appropriate form of executable for the target
# platform.
entry_points={"console_scripts": ["sublime-music=sublime_music.__main__:main"]},
)
__version__ = "0.11.10"
__version__ = "0.11.11-devel"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment