#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" import os import re from setuptools import find_packages, setup HERE = os.path.dirname(os.path.abspath(__file__)) def get_version() -> str: filename: str = os.path.join(HERE, "pgsync", "__init__.py") with open(filename) as fp: contents = fp.read() pattern = r"^__version__ = \"(.*?)\"$" return re.search(pattern, contents, re.MULTILINE).group(1) # Package meta-data. NAME = "pgsync" DESCRIPTION = "Postgres/MySQL/MariaDB to Elasticsearch/OpenSearch sync" URL = "https://github.com/toluaina/pgsync" AUTHOR = MAINTAINER = "Tolu Aina" AUTHOR_EMAIL = MAINTAINER_EMAIL = "tolu@pgsync.com" PYTHON_REQUIRES = ">=3.10.0" VERSION = get_version() INSTALL_REQUIRES = [] KEYWORDS = [ "change data capture", "elasticsearch", "opensearch", "pgsync", "postgres", "mysql", "mariadb", ] LICENSE = "MIT" CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] SCRIPTS = ["bin/bootstrap", "bin/parallel_sync", "bin/pgsync"] # if building the source dist then add the sources PACKAGES = find_packages(include=["pgsync"]) with open("README.rst") as fp: README = fp.read() # install_requires comes from the loose direct dependencies in base.in; # the pip-compiled base.txt/dev.txt are lockfiles for environments. # Shipping exact pins in package metadata makes every requirements # refresh conflict with an already installed pgsync. with open("requirements/base.in") as fp: INSTALL_REQUIRES = [ line.strip() for line in fp if line.strip() and not line.strip().startswith(("#", "-")) ] setup( name=NAME, author=AUTHOR, license=LICENSE, maintainer=MAINTAINER, maintainer_email=MAINTAINER_EMAIL, author_email=AUTHOR_EMAIL, classifiers=CLASSIFIERS, python_requires=PYTHON_REQUIRES, description=DESCRIPTION, long_description=README, long_description_content_type="text/x-rst", install_requires=INSTALL_REQUIRES, include_package_data=True, keywords=KEYWORDS, packages=PACKAGES, scripts=SCRIPTS, url=URL, version=VERSION, zip_safe=False, project_urls={ "Bug Reports": "https://github.com/toluaina/pgsync/issues", "Funding": "https://github.com/sponsors/toluaina", "Source": URL, "Web": "https://pgsync.com", "Documentation": "https://pgsync.com", }, )