Switch to PEP517 standard for builds (#887)

* Sync setup.cfg with requirements.txt

* Include tests in PyPI tarballs

And exclude them from setuptools

* Set version number only once

Switch to PEP517 standard (pyproject.toml) for builds
main
Anna 2022-11-25 23:24:38 +00:00 committed by GitHub
parent d099b46336
commit 08b16f5a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 4 deletions

View File

@ -2,4 +2,5 @@ graft app/static
graft app/templates
graft app/misc
include requirements.txt
recursive-include test
global-exclude *.pyc

View File

@ -16,6 +16,7 @@ from dotenv import load_dotenv
from werkzeug.middleware.proxy_fix import ProxyFix
from app.utils.misc import read_config_bool
from app.version import __version__
app = Flask(__name__, static_folder=os.path.dirname(
os.path.abspath(__file__)) + '/static')
@ -36,7 +37,7 @@ if read_config_bool('HTTPS_ONLY'):
app.config['SESSION_COOKIE_NAME'] = '__Secure-session'
app.config['SESSION_COOKIE_SECURE'] = True
app.config['VERSION_NUMBER'] = '0.8.0'
app.config['VERSION_NUMBER'] = __version__
app.config['APP_ROOT'] = os.getenv(
'APP_ROOT',
os.path.dirname(os.path.abspath(__file__)))

View File

@ -1,8 +1,7 @@
import os
import setuptools
optional_dev_tag = ''
if os.getenv('DEV_BUILD'):
optional_dev_tag = '.dev' + os.getenv('DEV_BUILD')
setuptools.setup(version='0.8.0' + optional_dev_tag)
__version__ = '0.8.0' + optional_dev_tag

3
pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

View File

@ -1,5 +1,6 @@
[metadata]
name = whoogle-search
version = attr: app.version.__version__
url = https://github.com/benbusby/whoogle-search
description = Self-hosted, ad-free, privacy-respecting metasearch engine
long_description = file: README.md
@ -18,11 +19,11 @@ packages = find:
include_package_data = True
install_requires=
beautifulsoup4
brotli
cssutils
cryptography
defusedxml
Flask
Flask-Session
python-dotenv
requests
stem
@ -34,6 +35,10 @@ test =
python-dateutil
dev = pycodestyle
[options.packages.find]
exclude =
test*
[options.entry_points]
console_scripts =
whoogle-search = app.routes:run_app