diff --git a/manage b/manage index 0f19375793..2fe2c52e19 100755 --- a/manage +++ b/manage @@ -377,9 +377,8 @@ pyenv.install() { pyenv.uninstall() { build_msg PYENV "[pyenv.uninstall] uninstall packages: ${PYOBJECTS}" - pyenv.cmd python setup.py develop --uninstall 2>&1 \ + pyenv.cmd python -m pip uninstall -y searx 2>&1 \ | prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] " - } pypi.upload() { diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..0d4a1498e5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=80", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 2f9519a630..ef0359e813 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ Brotli~=1.1 babel~=2.15 -certifi~=2025.1.31 +certifi~=2025.6.15 flask-babel~=4.0 flask~=3.0 jinja2~=3.1 diff --git a/setup.py b/setup.py index 61227d1991..49468a2917 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,33 @@ # -*- coding: utf-8 -*- """Installer for Searx package.""" -from setuptools import setup -from setuptools import find_packages - import os import sys -from searx.version import VERSION_STRING -from searx import brand +from setuptools import find_packages, setup + + +version_ns = {} +with open(os.path.join('searx', 'version.py')) as f: + exec(f.read(), version_ns) +VERSION_STRING = version_ns.get('VERSION_STRING', '') + +brand = {} +with open(os.path.join('utils', 'brand.env')) as f: + for line in f: + line = line.strip() + + if not line or line.startswith('#'): + continue + + if line.startswith('export '): + line = line[len('export '):] + + if '=' in line: + key, val = line.split('=', 1) + key = key.strip() + val = val.strip().strip("'").strip('"') + brand[key] = val with open('README.rst', encoding='utf-8') as f: long_description = f.read() @@ -24,10 +43,10 @@ version=VERSION_STRING, description="A privacy-respecting, hackable metasearch engine", long_description=long_description, - url=brand.DOCS_URL, + url=brand.get("DOCS_URL", ""), project_urls={ - "Code": brand.GIT_URL, - "Issue tracker": brand.ISSUE_URL + "Code": brand.get("GIT_URL", ""), + "Issue tracker": brand.get("ISSUE_URL", ""), }, classifiers=[ "Development Status :: 4 - Beta", diff --git a/utils/lib.sh b/utils/lib.sh index a511e3796c..a479a87961 100755 --- a/utils/lib.sh +++ b/utils/lib.sh @@ -690,10 +690,10 @@ pyenv.uninstall() { build_msg PYENV "[uninstall] ${PYOBJECTS}" if [ "." = "${PYOBJECTS}" ]; then - pyenv.cmd python setup.py develop --uninstall 2>&1 \ + pyenv.cmd python -m pip uninstall --yes . 2>&1 \ | prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] " else - pyenv.cmd python -m pip uninstall --yes ${PYOBJECTS} 2>&1 \ + pyenv.cmd python -m pip uninstall --yes ${PYOBJECTS} 2>&1 \ | prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] " fi }