Get on board with modern Python packaging conventions.

Remember when we used to make fun of Java people for sticking
everything in a `src/` directory?
This commit is contained in:
Solderpunk 2023-11-22 11:20:05 +01:00
parent 188cacca1f
commit 48c8fd9543
8 changed files with 34 additions and 29 deletions

26
pyproject.toml Executable file
View File

@ -0,0 +1,26 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "AV-98"
dynamic = ["version"]
description = "Command line Gemini client"
authors = [{name="Solderpunk", email="solderpunk@posteo.net"}]
classifiers = [
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Communications",
"Intended Audience :: End Users/Desktop",
"Environment :: Console",
"Development Status :: 5 - Production/Stable",
]
[project.urls]
Homepage = "https://tildegit.org/solderpunk/AV-98/"
Issues = "https://tildegit.org/solderpunk/AV-98/issues"
[project.scripts]
av98 = "av98.av98:main"
[project.optional-dependencies]
tofu = ["cryptography"]
colour = ["ansiwrap"]
[tool.setuptools.dynamic]
version = {attr = "av98.__version__"}

View File

@ -1,23 +0,0 @@
from setuptools import setup
setup(
name='AV-98',
version='1.0.2dev',
description="Command line Gemini client.",
author="Solderpunk",
author_email="solderpunk@sdf.org",
url='https://tildegit.org/solderpunk/AV-98/',
classifiers=[
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Communications',
'Intended Audience :: End Users/Desktop',
'Environment :: Console',
'Development Status :: 4 - Beta',
],
py_modules = ["av98"],
entry_points={
"console_scripts": ["av98=av98:main"]
},
install_requires=[],
)

1
src/av98/__init__.py Normal file
View File

@ -0,0 +1 @@
__version__ = "1.1.0dev"

View File

@ -40,10 +40,11 @@ try:
except ModuleNotFoundError:
import textwrap
from cache import Cache
from tofu import TofuStore
from clientcerts import ClientCertificateManager
import util
from av98 import __version__
from av98.cache import Cache
from av98.tofu import TofuStore
from av98.clientcerts import ClientCertificateManager
import av98.util as util
_VERSION = "1.1.0dev"
@ -1380,7 +1381,7 @@ current gemini browsing session."""
def do_version(self, line):
"""Display version information."""
print("AV-98 " + _VERSION)
print("AV-98 " + __version__)
### The end!
def do_quit(self, *args):

View File

@ -4,7 +4,7 @@ import os
import os.path
import uuid
import util
import av98.util as util
ui_out = logging.getLogger("av98_logger")