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
pull/899/head
Anna 1 year ago committed by GitHub
parent d099b46336
commit 08b16f5a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -16,6 +16,7 @@ from dotenv import load_dotenv
from werkzeug.middleware.proxy_fix import ProxyFix from werkzeug.middleware.proxy_fix import ProxyFix
from app.utils.misc import read_config_bool from app.utils.misc import read_config_bool
from app.version import __version__
app = Flask(__name__, static_folder=os.path.dirname( app = Flask(__name__, static_folder=os.path.dirname(
os.path.abspath(__file__)) + '/static') 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_NAME'] = '__Secure-session'
app.config['SESSION_COOKIE_SECURE'] = True 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.config['APP_ROOT'] = os.getenv(
'APP_ROOT', 'APP_ROOT',
os.path.dirname(os.path.abspath(__file__))) os.path.dirname(os.path.abspath(__file__)))

@ -1,8 +1,7 @@
import os import os
import setuptools
optional_dev_tag = '' optional_dev_tag = ''
if os.getenv('DEV_BUILD'): if os.getenv('DEV_BUILD'):
optional_dev_tag = '.dev' + 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

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

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

Loading…
Cancel
Save