diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 833e902ada517548318a2fc9cfd1c1d4cd3514dd..d3ab1fb0e0318d910e20670f72aa3e0233fb734c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,3 +2,11 @@ include: - project: shore/ci-stuff file: templates/pre-commit.yml + - project: shore/ci-stuff + file: templates/python.yml + +install-wheel: + extends: .install-wheel + script: + - python3 -m yamltool + - yt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77487b0d12001623601f729d2137e83e497883cc..41ea1a5d5a1dc6e8fe58cae4810e2b9fb6be5ebd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -63,7 +63,7 @@ repos: --line-length=79 - repo: https://github.com/PyCQA/prospector.git - rev: 1.5.1 + rev: 1.5.3.1 hooks: - id: prospector args: diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..3db680179333f6783a5aac2ba617d805df1d44dd --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include *.rst +include *.txt +exclude .pre-commit-config.yaml +exclude .gitlab-ci.yml +exclude .gitignore diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..926019b55f5f748435f397c0777a0522bcea13af --- /dev/null +++ b/setup.cfg @@ -0,0 +1,11 @@ +[bumpversion] +current_version = 0.0.1 +commit = True +tag = True + +[bdist_wheel] +universal = 1 + +[bumpversion:file:setup.py] + +[bumpversion:glob:*/__init__.py] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..0223a08a8c620ad221700d2e2dadac6d63421f89 --- /dev/null +++ b/setup.py @@ -0,0 +1,41 @@ +from setuptools import setup, find_packages +import yamltool + +with open("README.rst", "r", encoding="utf-8") as readme: + long_description = readme.read() + +setup( + name="yamltool", + version=yamltool.__version__, + description=yamltool.__doc__.splitlines()[0], + long_description=long_description, + long_description_content_type="text/x-rst", + url="https://git.shore.co.il/nimrod/yamltool", + author="Nimrod Adar", + author_email="nimrod@shore.co.il", + license="MIT", + classifiers=[ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Software Development", + "Topic :: Software Development :: Debuggers", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Text Processing :: Markup", + "Topic :: Utilities", + ], + keywords="yaml", + packages=find_packages(), + install_requires=[ + "ruamel.yaml>=0.15.0", + ], + entry_points={"console_scripts": ["yt=yamltool.__main__:main"]}, +) diff --git a/yamltool/__init__.py b/yamltool/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..892e8e958b0609b6e322eab042f94c89742f2e6a --- /dev/null +++ b/yamltool/__init__.py @@ -0,0 +1,9 @@ +"""YAML tool, a clone of the json.tool Python module for YAML. + +This tool provides a simple command line interface to validate and pretty-print +YAML documents while trying to preserve as much as possible from the original +documents (like comments and anchors). +""" + + +__version__ = "0.0.1" diff --git a/yamltool/__main__.py b/yamltool/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..2346b0e77329ed8d275726d9a1a0d8da017ba015 --- /dev/null +++ b/yamltool/__main__.py @@ -0,0 +1,15 @@ +"""YAML tool, a clone of the json.tool Python module for YAML. + +This tool provides a simple command line interface to validate and pretty-print +YAML documents while trying to preserve as much as possible from the original +documents (like comments and anchors). +""" + + +def main(): + """Main entrypoint.""" + return + + +if __name__ == "__main__": + main()