diff --git a/.gitignore b/.gitignore index 5a15ce2a6..71db65182 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ rpmbuild/ .rpm-builder-flag .VERSION kubectl +/receptorctl/AUTHORS +/receptorctl/ChangeLog diff --git a/Makefile b/Makefile index 604c016c4..1a4a6b70e 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,6 @@ rpms: $(RPMS) RECEPTORCTL_WHEEL = receptorctl/dist/receptorctl-$(VERSION)-py3-none-any.whl $(RECEPTORCTL_WHEEL): receptorctl/README.md receptorctl/setup.py $(shell find receptorctl/receptorctl -type f -name '*.py') - @echo $(VERSION) > .VERSION @cd receptorctl && python3 setup.py bdist_wheel receptorctl_wheel: $(RECEPTORCTL_WHEEL) @@ -151,7 +150,6 @@ receptorctl_sdist: $(RECEPTORCTL_SDIST) RECEPTOR_PYTHON_WORKER_WHEEL = receptor-python-worker/dist/receptor_python_worker-$(VERSION)-py3-none-any.whl $(RECEPTOR_PYTHON_WORKER_WHEEL): receptor-python-worker/README.md receptor-python-worker/setup.py $(shell find receptor-python-worker/receptor_python_worker -type f -name '*.py') - @echo $(VERSION) > .VERSION @cd receptor-python-worker && python3 setup.py bdist_wheel container: .container-flag-$(VERSION) diff --git a/receptorctl/MANIFEST.in b/receptorctl/MANIFEST.in new file mode 100644 index 000000000..72aa2133c --- /dev/null +++ b/receptorctl/MANIFEST.in @@ -0,0 +1 @@ +include requirements.txt # Needs manual inclusion due to PBR bug diff --git a/receptorctl/requirements.txt b/receptorctl/requirements.txt new file mode 100644 index 000000000..27e24fdf2 --- /dev/null +++ b/receptorctl/requirements.txt @@ -0,0 +1,3 @@ +python-dateutil +click +pyyaml diff --git a/receptorctl/setup.cfg b/receptorctl/setup.cfg new file mode 100644 index 000000000..ba2ddce30 --- /dev/null +++ b/receptorctl/setup.cfg @@ -0,0 +1,16 @@ +[metadata] +name = receptorctl +author = Red Hat +author-email = info@ansible.com +summary = "Receptorctl is a front-end CLI and importable Python library that interacts with Receptor over its control socket interface." +home-page = https://github.com/project-receptor/receptor/tree/devel/receptorctl +description-file = README.md +description-content-type = text/markdown + +[entry_points] +console_scripts = + receptorctl = receptorctl:run + +[files] +packages = + receptorctl diff --git a/receptorctl/setup.py b/receptorctl/setup.py index 494be2bd8..aa2d8a019 100644 --- a/receptorctl/setup.py +++ b/receptorctl/setup.py @@ -1,50 +1,8 @@ #!/usr/bin/env python -import os -import subprocess -from setuptools import setup, find_packages - -with open('README.md', 'r') as f: - long_description = f.read() - -verfile = None -for fn in ['.VERSION', '../.VERSION']: - if os.path.exists(fn): - verfile = fn - break - -if verfile is None: - subprocess.run(["make", "version"], cwd="../") - verfile = '../.VERSION' - - if not os.path.exists(verfile): - raise IOError("Version file not found.") - -with open(verfile, 'r') as f: - version = f.readline().rstrip('\n\r') +from setuptools import setup setup( - name="receptorctl", - version=version, - author='Red Hat', - url="https://github.com/project-receptor/receptor/receptorctl", - license='APL 2.0', - packages=find_packages(), - long_description=long_description, - long_description_content_type='text/markdown', - install_requires=[ - "setuptools", - "python-dateutil", - "click", - "pyyaml" - ], - zip_safe=False, - entry_points={ - 'console_scripts': [ - 'receptorctl=receptorctl:run' - ] - }, - classifiers=[ - "Programming Language :: Python :: 3", - ], + setup_requires=['pbr'], + pbr=True, )