diff --git a/.gitignore b/.gitignore index 880fc37..5a25ec6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ htmlcov dist/ docs/build .venv -.DS_store \ No newline at end of file +build/ +.DS_store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24f11b9..8bad891 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,4 +9,4 @@ repos: hooks: - id: flake8 language_version: python3 - args: [--config, kbatch/setup.cfg] \ No newline at end of file + args: [--config, setup.cfg] diff --git a/docs/source/conf.py b/docs/source/conf.py index b420892..59e276d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = "Tom Augspurger" # The full version, including alpha/beta/rc tags -release = "0.4.2" +release = "0.5.0.dev0" # -- General configuration --------------------------------------------------- diff --git a/kbatch-proxy/LICENSE b/kbatch-proxy/LICENSE new file mode 100644 index 0000000..48ea661 --- /dev/null +++ b/kbatch-proxy/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE diff --git a/kbatch-proxy/pyproject.toml b/kbatch-proxy/pyproject.toml new file mode 100644 index 0000000..7d13959 --- /dev/null +++ b/kbatch-proxy/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ["setuptools", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "kbatch-proxy" +version = "0.5.0.dev0" +description = "Proxy batch job requests to kubernetes" +authors = [{ name = "Tom Augspurger", email = "taugspurger@microsoft.com" }] +classifiers = [ + "Development Status :: 3 - Alpha", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Framework :: Jupyter", + "License :: OSI Approved :: MIT License", +] +license = {file = "LICENSE"} +readme = "README.md" +requires-python = ">=3.9" +dependencies = [ + "escapism", + "fastapi", + "httpx", + "jupyterhub>=3", + "kubernetes", + "pydantic>=2,<3", + "pydantic-settings", + "rich", +] + +[project.urls] +Homepage = "https://github.com/kbatch-dev/kbatch" +Documentation = "https://kbatch.readthedocs.io" +Source = "https://github.com/kbatch-dev/kbatch" +Tracker = "https://github.com/kbatch-dev/kbatch/issues" + +[project.optional-dependencies] +all = ["kbatch-proxy[dev,test]"] +test = [ + "pytest", + "pytest-mock", +] +dev = [ + "uvicorn[standard]", + "gunicorn==23.*", + "rich", + "sphinx", + "myst-parser", + "sphinx-click", + "pydata-sphinx-theme", +] + +[tool.setuptools.dynamic] +readme = { file = "README.md", content-type = "text/markdown" } + +[tool.setuptools.packages.find] +where = [""] +include = ["kbatch*"] + +[tool.setuptools_scm] +# we don't actually use setuptools_scm for versions, +# only the file-finder +fallback_version = "0.0.0" diff --git a/kbatch-proxy/setup.cfg b/kbatch-proxy/setup.cfg deleted file mode 100644 index ed0c198..0000000 --- a/kbatch-proxy/setup.cfg +++ /dev/null @@ -1,41 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" - -[metadata] -name = kbatch-proxy -version = 0.4.2 -description = Proxy batch job requests to kubernetes. -long_description = file: README.md -long_description_content_type = text/markdown -author = Tom Augspurger -author_email = taugspurger@microsoft.com -url = https://github.com/kbatch-dev/kbatch - -[options] -packages = find: -install_requires = - escapism - fastapi - httpx - jupyterhub>=3 - kubernetes - pydantic>=2,<3 - pydantic-settings - -[options.extras_require] -all = - %(test)s - %(dev)s -test = - pytest - pytest-mock - -dev = - uvicorn[standard] - gunicorn==20.1.0 - rich - -[options.entry_points] -console_scripts = - kbatch = kbatch.cli:cli diff --git a/kbatch/LICENSE b/kbatch/LICENSE new file mode 100644 index 0000000..48ea661 --- /dev/null +++ b/kbatch/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE diff --git a/kbatch/kbatch/README.md b/kbatch/README.md similarity index 100% rename from kbatch/kbatch/README.md rename to kbatch/README.md diff --git a/kbatch/kbatch/__init__.py b/kbatch/kbatch/__init__.py index ddb7164..a588085 100644 --- a/kbatch/kbatch/__init__.py +++ b/kbatch/kbatch/__init__.py @@ -17,7 +17,7 @@ from ._backend import make_job, make_cronjob -__version__ = "0.4.2" +__version__ = "0.5.0.dev0" __all__ = [ "__version__", diff --git a/kbatch/pyproject.toml b/kbatch/pyproject.toml new file mode 100644 index 0000000..2c0bfce --- /dev/null +++ b/kbatch/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ["setuptools", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "kbatch" +version = "0.5.0.dev0" +description = "Submit batch jobs to Kubernetes" +authors = [{ name = "Tom Augspurger", email = "taugspurger@microsoft.com" }] +classifiers = [ + "Development Status :: 3 - Alpha", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Framework :: Jupyter", + "License :: OSI Approved :: MIT License", +] +license = {file = "LICENSE"} +readme = "README.md" +requires-python = ">=3.9" +dependencies = [ + "click", + "rich", + "httpx", + "pyyaml", + "kubernetes", +] + +[project.urls] +Homepage = "https://github.com/kbatch-dev/kbatch" +Documentation = "https://kbatch.readthedocs.io" +Source = "https://github.com/kbatch-dev/kbatch" +Tracker = "https://github.com/kbatch-dev/kbatch/issues" + +[project.scripts] +kbatch = "kbatch.cli:main" + +[project.optional-dependencies] +all = ["kbatch[docs]", "kbatch[test]"] +test = [ + "pytest", + "respx", + "mypy", + "types-pyyaml", + "pre-commit", +] +docs = [ + "sphinx", + "myst-parser", + "sphinx-click", + "pydata-sphinx-theme", +] + +[tool.setuptools.dynamic] +readme = { file = "README.md", content-type = "text/markdown" } + +[tool.setuptools.packages.find] +where = [""] +include = ["kbatch*"] + +[tool.setuptools_scm] +# we don't actually use setuptools_scm for versions, +# only the file-finder +fallback_version = "0.0.0" diff --git a/kbatch/setup.cfg b/kbatch/setup.cfg deleted file mode 100644 index a6e87e2..0000000 --- a/kbatch/setup.cfg +++ /dev/null @@ -1,69 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" - -[metadata] -name = kbatch -version = 0.4.2 -description = Submit batch jobs to Kubernetes. -long_description = file: README.md -long_description_content_type = text/markdown -author = Tom Augspurger -author_email = taugspurger@microsoft.com -url = https://github.com/kbatch-dev/kbatch - -[options] -packages = find: -install_requires = - click - rich - httpx - pyyaml - kubernetes - -[options.extras_require] -all = - %(docs)s - %(test)s -test = - pytest - respx - mypy - types-PyYAML - pre-commit - -docs = - sphinx - myst-parser - sphinx-click - pydata-sphinx-theme - -[options.entry_points] -console_scripts = - kbatch = kbatch.cli:main - -[flake8] -exclude = - __init__.py, - _version.py, - jupyterhub_config.py, - jupyterhub_config_local.py, - 0001_initial.py, -ignore = - # Import formatting - E4, - # Space before : - E203, - # Comparing types instead of isinstance - E721, - # Assign a lambda - E731, - # Ambiguous variable names - E741, - # Allow breaks before/after binary operators - W503, - W504 - -# black is set to 88, but isn't a strict limit so we add some wiggle room for -# flake8 testing. -max-line-length = 100 diff --git a/pyproject.toml b/pyproject.toml index ea4f6a1..6cc6f47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,4 +26,41 @@ module = [ "kubernetes.watch", "kubernetes.client.models", ] -ignore_missing_imports = true \ No newline at end of file +ignore_missing_imports = true + +[tool.tbump.version] +current = "0.5.0.dev0" + +# Example of a semver regexp. +# Make sure this matches current_version before +# using tbump +regex = ''' + (?P\d+) + \. + (?P\d+) + \. + (?P\d+) + (?P
((a|b|rc)\d+)|)
+  \.?
+  (?P(?<=\.)dev\d*|)
+  '''
+
+[tool.tbump.git]
+message_template = "Bump to {new_version}"
+tag_template = "{new_version}"
+
+[[tool.tbump.file]]
+src = "kbatch/pyproject.toml"
+search = 'version = "{current_version}"'
+
+[[tool.tbump.file]]
+src = "kbatch/kbatch/__init__.py"
+search = '__version__ = "{current_version}"'
+
+[[tool.tbump.file]]
+src = "kbatch-proxy/pyproject.toml"
+search = 'version = "{current_version}"'
+
+[[tool.tbump.file]]
+src = "docs/source/conf.py"
+search = 'release = "{current_version}"'
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..5b3df40
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,21 @@
+[flake8]
+exclude =
+    jupyterhub_config.py,
+ignore =
+    # Import formatting
+    E4,
+    # Space before :
+    E203,
+    # Comparing types instead of isinstance
+    E721,
+    # Assign a lambda
+    E731,
+    # Ambiguous variable names
+    E741,
+    # Allow breaks before/after binary operators
+    W503,
+    W504
+
+# black is set to 88, but isn't a strict limit so we add some wiggle room for
+# flake8 testing.
+max-line-length = 100