diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3d024b0..dab35c3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,12 +29,6 @@ jobs: matrix: include: # oldest supported python and jupyterhub version - - python-version: "3.8" - pip-install-spec: "jupyterhub==2.3.0 tornado==5.1.0 sqlalchemy==1.*" - runs-on: ubuntu-20.04 - - python-version: "3.9" - pip-install-spec: "jupyterhub==2.* sqlalchemy==1.*" - runs-on: ubuntu-22.04 - python-version: "3.10" pip-install-spec: "jupyterhub==3.*" runs-on: ubuntu-22.04 diff --git a/.gitignore b/.gitignore index 72364f9..28c5477 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Byte-compiled / optimized / DLL files __pycache__/ +.DS_Store *.py[cod] *$py.class diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a73e0e..37202a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,8 +14,6 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: - - --py38-plus # Autoformat: Python code - repo: https://github.com/PyCQA/autoflake @@ -39,8 +37,8 @@ repos: - id: black # Autoformat: markdown, yaml - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.7.3 hooks: - id: prettier diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 04f196a..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include README.md -include LICENSE diff --git a/pyproject.toml b/pyproject.toml index 4f1a8fd..1e2186e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "jupyterhub-systemdspawner" +dynamic = ["version"] +description = "JupyterHub Spawner using systemd for resource isolation" +readme = "README.md" +requires-python = ">=3.10" +license = "BSD-3-Clause" +authors = [ + { name = "Jupyter Contributors", email = "jupyter@googlegroups.com" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3", +] +dependencies = [ + "jupyterhub>=3.1.1", + "tornado>=6.1", +] + +[project.urls] +Source = "https://github.com/jupyterhub/systemdspawner" +Issues = "https://github.com/jupyterhub/systemdspawner/issues" +[project.optional-dependencies] +test = [ + "pytest", + "pytest-asyncio", + "pytest-cov", + "pytest-jupyterhub", +] + +[project.entry-points."jupyterhub.spawners"] +systemd = "systemdspawner:SystemdSpawner" +systemdspawner = "systemdspawner:SystemdSpawner" + +[tool.hatch.build.targets.wheel] +# need to specify package name because it doesn't match project.name +packages = ["systemdspawner"] + +[tool.hatch.version] +path = "systemdspawner/__init__.py" + # autoflake is used for autoformatting Python code # # ref: https://github.com/PyCQA/autoflake#readme @@ -17,21 +62,6 @@ remove-unused-variables = true profile = "black" -# black is used for autoformatting Python code -# -# ref: https://black.readthedocs.io/en/stable/ -# -[tool.black] -# target-version should be all supported versions, see -# https://github.com/psf/black/issues/751#issuecomment-473066811 -target_version = [ - "py38", - "py39", - "py310", - "py311", -] - - # pytest is used for running Python based tests # # ref: https://docs.pytest.org/en/stable/ @@ -73,4 +103,4 @@ message_template = "Bump to {new_version}" tag_template = "v{new_version}" [[tool.tbump.file]] -src = "setup.py" +src = "systemdspawner/__init__.py" diff --git a/setup.py b/setup.py deleted file mode 100644 index 5b38644..0000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup - -with open("README.md") as f: - long_description = f.read() - -setup( - name="jupyterhub-systemdspawner", - version="1.0.3.dev", - description="JupyterHub Spawner using systemd for resource isolation", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/jupyterhub/systemdspawner", - author="Yuvi Panda", - author_email="yuvipanda@gmail.com", - license="3 Clause BSD", - packages=["systemdspawner"], - entry_points={ - "jupyterhub.spawners": [ - "systemd = systemdspawner:SystemdSpawner", - "systemdspawner = systemdspawner:SystemdSpawner", - ], - }, - python_requires=">=3.8", - install_requires=[ - "jupyterhub>=2.3.0", - "tornado>=5.1", - ], - extras_require={ - "test": [ - "pytest", - "pytest-asyncio", - "pytest-cov", - "pytest-jupyterhub", - ], - }, -) diff --git a/systemdspawner/__init__.py b/systemdspawner/__init__.py index db6a7af..83de007 100644 --- a/systemdspawner/__init__.py +++ b/systemdspawner/__init__.py @@ -1,3 +1,4 @@ from systemdspawner.systemdspawner import SystemdSpawner +__version__ = "1.0.3.dev" __all__ = [SystemdSpawner]