Skip to content

Commit 08b16f5

Browse files
authored
Switch to PEP517 standard for builds (benbusby#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
1 parent d099b46 commit 08b16f5

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ graft app/static
22
graft app/templates
33
graft app/misc
44
include requirements.txt
5+
recursive-include test
56
global-exclude *.pyc

app/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from werkzeug.middleware.proxy_fix import ProxyFix
1717

1818
from app.utils.misc import read_config_bool
19+
from app.version import __version__
1920

2021
app = Flask(__name__, static_folder=os.path.dirname(
2122
os.path.abspath(__file__)) + '/static')
@@ -36,7 +37,7 @@
3637
app.config['SESSION_COOKIE_NAME'] = '__Secure-session'
3738
app.config['SESSION_COOKIE_SECURE'] = True
3839

39-
app.config['VERSION_NUMBER'] = '0.8.0'
40+
app.config['VERSION_NUMBER'] = __version__
4041
app.config['APP_ROOT'] = os.getenv(
4142
'APP_ROOT',
4243
os.path.dirname(os.path.abspath(__file__)))

setup.py renamed to app/version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
2-
import setuptools
32

43
optional_dev_tag = ''
54
if os.getenv('DEV_BUILD'):
65
optional_dev_tag = '.dev' + os.getenv('DEV_BUILD')
76

8-
setuptools.setup(version='0.8.0' + optional_dev_tag)
7+
__version__ = '0.8.0' + optional_dev_tag

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[metadata]
22
name = whoogle-search
3+
version = attr: app.version.__version__
34
url = https://github.com/benbusby/whoogle-search
45
description = Self-hosted, ad-free, privacy-respecting metasearch engine
56
long_description = file: README.md
@@ -18,11 +19,11 @@ packages = find:
1819
include_package_data = True
1920
install_requires=
2021
beautifulsoup4
22+
brotli
2123
cssutils
2224
cryptography
2325
defusedxml
2426
Flask
25-
Flask-Session
2627
python-dotenv
2728
requests
2829
stem
@@ -34,6 +35,10 @@ test =
3435
python-dateutil
3536
dev = pycodestyle
3637

38+
[options.packages.find]
39+
exclude =
40+
test*
41+
3742
[options.entry_points]
3843
console_scripts =
3944
whoogle-search = app.routes:run_app

0 commit comments

Comments
 (0)