mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-14 03:56:08 +00:00
Include docs/api-spec.yaml inside the shippable package
This commit is contained in:
2
.github/workflows/pypi-release.yml
vendored
2
.github/workflows/pypi-release.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
test-pypi-package:
|
test-pypi-package:
|
||||||
name: Test the built 📦 package works basically.
|
name: Test the built package works basically.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
recursive-include changedetectionio/api *
|
recursive-include changedetectionio/api *
|
||||||
include docs/api-spec.yaml
|
recursive-include changedetectionio/docs *
|
||||||
recursive-include changedetectionio/blueprint *
|
recursive-include changedetectionio/blueprint *
|
||||||
recursive-include changedetectionio/conditions *
|
recursive-include changedetectionio/conditions *
|
||||||
recursive-include changedetectionio/content_fetchers *
|
recursive-include changedetectionio/content_fetchers *
|
||||||
|
|||||||
19
setup.py
19
setup.py
@@ -5,6 +5,8 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
import shutil
|
||||||
|
|
||||||
here = os.path.abspath(os.path.dirname(__file__))
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
@@ -22,6 +24,20 @@ def find_version(*file_paths):
|
|||||||
raise RuntimeError("Unable to find version string.")
|
raise RuntimeError("Unable to find version string.")
|
||||||
|
|
||||||
|
|
||||||
|
class BuildPyCommand(build_py):
|
||||||
|
"""Custom build command to copy api-spec.yaml to the package."""
|
||||||
|
def run(self):
|
||||||
|
build_py.run(self)
|
||||||
|
# Ensure the docs directory exists in the build output
|
||||||
|
docs_dir = os.path.join(self.build_lib, 'changedetectionio', 'docs')
|
||||||
|
os.makedirs(docs_dir, exist_ok=True)
|
||||||
|
# Copy api-spec.yaml to the package
|
||||||
|
shutil.copy(
|
||||||
|
os.path.join(here, 'docs', 'api-spec.yaml'),
|
||||||
|
os.path.join(docs_dir, 'api-spec.yaml')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
install_requires = open('requirements.txt').readlines()
|
install_requires = open('requirements.txt').readlines()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@@ -37,9 +53,10 @@ setup(
|
|||||||
scripts=["changedetection.py"],
|
scripts=["changedetection.py"],
|
||||||
author='dgtlmoon',
|
author='dgtlmoon',
|
||||||
url='https://changedetection.io',
|
url='https://changedetection.io',
|
||||||
packages=['changedetectionio'],
|
packages=find_packages(include=['changedetectionio', 'changedetectionio.*']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
|
cmdclass={'build_py': BuildPyCommand},
|
||||||
license="Apache License 2.0",
|
license="Apache License 2.0",
|
||||||
python_requires=">= 3.10",
|
python_requires=">= 3.10",
|
||||||
classifiers=['Intended Audience :: Customer Service',
|
classifiers=['Intended Audience :: Customer Service',
|
||||||
|
|||||||
Reference in New Issue
Block a user