Make description attribute static
Hmm, seems the description can't be read from an attribute, why? Anyway, it's not like it changes often. Lets copy it, and add a note to change the python code to read from importlib.metadata, if we even want to? TODO: * compare the output file-by-file of pip install -e before and after * compare the output file-by-file of setup.py install/build/wheel or whatever and the corresponding build commands (and update makefile) * think about removing stuff that isn't used from `__init__.py`, or making it read from importlib.metadata * see how it looks with hatch (dynamic bits and build hooks)
This commit is contained in:
parent
f72ce65e8e
commit
f9808b55ab
|
|
@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "qutebrowser"
|
name = "qutebrowser"
|
||||||
|
description = "A keyboard-driven, vim-like browser based on Python and Qt."
|
||||||
# What about the other libs in requirements.txt?
|
# What about the other libs in requirements.txt?
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jinja2",
|
"jinja2",
|
||||||
|
|
@ -41,7 +42,6 @@ classifiers = [
|
||||||
# https://discuss.python.org/t/please-make-package-version-go-away/58501/11
|
# https://discuss.python.org/t/please-make-package-version-go-away/58501/11
|
||||||
dynamic = [
|
dynamic = [
|
||||||
"version",
|
"version",
|
||||||
"description",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
|
|
@ -57,8 +57,10 @@ funding = "https://github.com/qutebrowser/qutebrowser/blob/main/README.asciidoc#
|
||||||
qutebrowser = "qutebrowser.qutebrowser:main"
|
qutebrowser = "qutebrowser.qutebrowser:main"
|
||||||
|
|
||||||
[tool.setuptools.dynamic]
|
[tool.setuptools.dynamic]
|
||||||
version = {attr = "qutebrowser.__version__"}
|
# We can't import a variable from qutebrowser/__init__.py because when we put
|
||||||
description = {attr = "qutebrowser.__description__"}
|
# "qutebrowser" here setuptools resolves that to "qutebrowser/qutebrowser.py".
|
||||||
|
# So just import the attribute from that qutebrowser.py file.
|
||||||
|
version = {attr = "qutebrowser.qutebrowser.__version__"}
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["qutebrowser", "qutebrowser.*"] # package names should match these glob patterns (["*"] by default)
|
include = ["qutebrowser", "qutebrowser.*"] # package names should match these glob patterns (["*"] by default)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import qutebrowser
|
import qutebrowser
|
||||||
|
from qutebrowser import __version__
|
||||||
try:
|
try:
|
||||||
from qutebrowser.misc.checkpyver import check_python_version
|
from qutebrowser.misc.checkpyver import check_python_version
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
||||||
3
setup.py
3
setup.py
|
|
@ -40,7 +40,7 @@ import setuptools
|
||||||
# * version=_get_constant('version'),
|
# * version=_get_constant('version'),
|
||||||
# * dynamic in setuptools
|
# * dynamic in setuptools
|
||||||
# * description=_get_constant('description'),
|
# * description=_get_constant('description'),
|
||||||
# * dynamic option in setuptools
|
# * support reading from file, but not attribute
|
||||||
# * author=_get_constant('author'),
|
# * author=_get_constant('author'),
|
||||||
# * author_email=_get_constant('email'),
|
# * author_email=_get_constant('email'),
|
||||||
# * both not dynamic and don't change much, duplicate or move
|
# * both not dynamic and don't change much, duplicate or move
|
||||||
|
|
@ -48,6 +48,7 @@ import setuptools
|
||||||
# * not dynamic, it's also not used anywhere else and doesn't change often
|
# * not dynamic, it's also not used anywhere else and doesn't change often
|
||||||
# * just duplicate it and leave a comment or move it completely
|
# * just duplicate it and leave a comment or move it completely
|
||||||
#
|
#
|
||||||
|
# Move duplicated stuff in __init__ to use importlib.metadata?
|
||||||
|
|
||||||
# Args to setup()
|
# Args to setup()
|
||||||
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration
|
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue