| 1 | #!/usr/bin/env python |
| 2 | # BSD 2-Clause License |
| 3 | # |
| 4 | # Apprise - Push Notification Library. |
| 5 | # Copyright (c) 2026, Chris Caron <[email protected]> |
| 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without |
| 8 | # modification, are permitted provided that the following conditions are met: |
| 9 | # |
| 10 | # 1. Redistributions of source code must retain the above copyright notice, |
| 11 | # this list of conditions and the following disclaimer. |
| 12 | # |
| 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
| 14 | # this list of conditions and the following disclaimer in the documentation |
| 15 | # and/or other materials provided with the distribution. |
| 16 | # |
| 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 27 | # POSSIBILITY OF SUCH DAMAGE. |
| 28 | |
| 29 | # |
| 30 | # 2025.07.10 NOTE: |
| 31 | # setup.py (Temporary shim for RHEL9 Package Building Only) |
| 32 | # Refer to tox for everything else; this will be removed once RHEL9 support |
| 33 | # is dropped. |
| 34 | # |
| 35 | import os |
| 36 | import re |
| 37 | |
| 38 | from setuptools import find_packages, setup |
| 39 | |
| 40 | |
| 41 | def read_version() -> str: |
| 42 | with open(os.path.join("apprise", "__init__.py"), encoding="utf-8") as f: |
| 43 | for line in f: |
| 44 | m = re.match(r'^__version__\s*=\s*[\'"]([^\'"]+)', line) |
| 45 | if m: |
| 46 | return m.group(1) |
| 47 | raise RuntimeError("Version not found") |
| 48 | |
| 49 | |
| 50 | # tox is not supported well in RHEL9 so this stub file is the only way to |
| 51 | # successfully build the RPM; packaging/redhat/python-apprise.spec has |
| 52 | # been updated accordingly to accommodate reference to this for older |
| 53 | # versions of the distribution only |
| 54 | setup( |
| 55 | name="apprise", |
| 56 | version=read_version(), |
| 57 | packages=find_packages(exclude=["tests*", "packaging*"]), |
| 58 | entry_points={ |
| 59 | "console_scripts": [ |
| 60 | "apprise = apprise.cli:main", |
| 61 | ], |
| 62 | }, |
| 63 | package_data={ |
| 64 | "apprise": [ |
| 65 | "assets/NotifyXML-*.xsd", |
| 66 | "assets/themes/default/*.png", |
| 67 | "assets/themes/default/*.ico", |
| 68 | "i18n/*.py", |
| 69 | "i18n/*/LC_MESSAGES/*.mo", |
| 70 | "py.typed", |
| 71 | "*.pyi", |
| 72 | "*/*.pyi", |
| 73 | ], |
| 74 | }, |
| 75 | ) |