Skip to content

Commit

Permalink
Fix package creation
Browse files Browse the repository at this point in the history
  • Loading branch information
shapovalovts committed Aug 25, 2024
1 parent eebb443 commit ccafad5
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .pypirc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ index-servers=pypi

[pypi]
repository=https://upload.pypi.org/legacy/
username=openworkload
username=__token__
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ prepare-venv:
.PHONY: format
format:
. .venv/bin/activate
$(VENV_BIN)/autoflake -i -r --ignore-init-module-imports swm_jupyter_spawner
$(VENV_BIN)/black swm_jupyter_spawner
$(VENV_BIN)/isort swm_jupyter_spawner
$(VENV_BIN)/autoflake -i -r --ignore-init-module-imports swmjupyter
$(VENV_BIN)/black swmjupyter
$(VENV_BIN)/isort swmjupyter

.PHONY: check
check:
. .venv/bin/activate
$(VENV_BIN)/ruff check swm_jupyter_spawner
$(VENV_BIN)/mypy swm_jupyter_spawner
$(VENV_BIN)/bandit -r swm_jupyter_spawner -c "pyproject.toml" --silent
$(VENV_BIN)/ruff check swmjupyter
$(VENV_BIN)/mypy swmjupyter
$(VENV_BIN)/bandit -r swmjupyter -c "pyproject.toml" --silent

.PHONY: package
package:
Expand All @@ -34,6 +34,8 @@ package:
.PHONY: clean
clean:
rm -f ./dist/*.whl
rm -fr swmjupyter.egg-info/*
rm -fr build/*

.PHONY: upload
upload:
Expand Down
4 changes: 2 additions & 2 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

# For development purpose we use the spawner package from the sources:
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from swm_jupyter_spawner.spawner import SwmSpawner
from swmjupyter.spawner import SwmSpawner

c.JupyterHub.hub_ip = '0.0.0.0'
c.JupyterHub.hub_port = 8081
c.JupyterHub.log_level = 'DEBUG'
c.JupyterHub.spawner_class = 'swm_jupyter_spawner.spawner.SwmSpawner'
c.JupyterHub.spawner_class = 'swmjupyter.spawner.SwmSpawner'
c.JupyterHub.authenticator_class = 'jupyterhub.auth.DummyAuthenticator'
c.JupyterHub.tornado_settings = {
"slow_spawn_timeout": 0,
Expand Down
63 changes: 20 additions & 43 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# coding: utf-8

import os
import sys
from codecs import open # to use a consistent encoding
from os import path
from subprocess import check_output

from distutils.core import setup
from pathlib import Path
from setuptools import find_packages
from setuptools import setup, find_packages

HERE = Path(__file__).parent.resolve()

def get_version():
cmd = "git describe --tags"
Expand All @@ -21,65 +20,43 @@ def get_version():


def get_long_description():
with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f:
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
return long_description


setup_args = dict(
name='swm_jupyter_spawner',
setup(
name="swmjupyter",
version=get_version(),
description="""A spawner for Jupyterhub to spawn notebooks over Sky Port""",
description="A spawner for JupyterHub to spawn notebooks over Sky Port",
long_description=get_long_description(),
long_description_content_type="text/markdown",
url="https://github.com/openworkload/swm-jupyter-term",
author="Taras Shapovalov",
author_email="taras@iclouds.net",
url="https://github.com/openworkload/swm-jupyter-term",
license="BSD",
platforms="Linux, Mac OS X, Windows",
packages=find_packages(),
license="BSD",
include_package_data=True,
python_requires=">=3.10, <4",
platforms="Linux",
keywords=[
"HPC",
"High Performance Computing",
"Cloud Computing",
"Sky Port",
"Open Workload"
"Open Workload",
"Sky Port"
],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
],
project_urls={
"Bug Reports": "https://github.com/openworkload/swm-jupyter-term/issues",
"Source": "https://github.com/openworkload/swm-jupyter-term",
},
)

# setuptools requirements
if "setuptools" in sys.modules:
setup_args["install_requires"] = install_requires = []
with open("requirements.txt") as f:
for line in f.readlines():
req = line.strip()
if not req or req.startswith(("-e", "#")):
continue
install_requires.append(req)


def main():
setup(**setup_args)

if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion swm_jupyter_spawner/spawner.py → swmjupyter/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SwmSpawner(Spawner): # type: ignore
_swm_cert_file = Unicode("~/.swm/cert.pem", help="PEM certificate file path", config=True) # type: ignore
_swm_job_id = None

_spool_dir = TemporaryDirectory(prefix=".swm_jupyter_spawner_")
_spool_dir = TemporaryDirectory(prefix=".swmjupyter_")
_msg_queue: Queue[tuple[str, int]] = Queue()
_last_msg: str = ""

Expand Down

0 comments on commit ccafad5

Please sign in to comment.