From cfd5167e06c1bcb4de98caefd0e36e1d3c6e399d Mon Sep 17 00:00:00 2001 From: pbashyal-nmdp Date: Tue, 19 Sep 2023 09:39:59 -0500 Subject: [PATCH 1/2] When running without a login, `os.getlogin()` fails. Switch to using `getuser()` from `getpass` module. --- pyard/misc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyard/misc.py b/pyard/misc.py index ae988f3..9a110ab 100644 --- a/pyard/misc.py +++ b/pyard/misc.py @@ -19,7 +19,7 @@ # > http://www.fsf.org/licensing/licenses/lgpl.html # > http://www.opensource.org/licenses/lgpl-license.php # -import os +import getpass import pathlib import tempfile from typing import List @@ -143,7 +143,10 @@ def get_imgt_version(imgt_version): def get_default_db_directory(): - username = os.getlogin() + try: + username = getpass.getuser() + except OSError: + username = "nonuser" return pathlib.Path(tempfile.gettempdir()) / f"pyard-{username}" From 25754c8802c93a3bb86c54a7a8ab9325f8f2e857 Mon Sep 17 00:00:00 2001 From: pbashyal-nmdp Date: Tue, 19 Sep 2023 09:41:12 -0500 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20version:=201.0.3=20=E2=86=92=201.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- api-spec.yaml | 2 +- pyard/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38fcd53..240bf4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL MAINTAINER="Pradeep Bashyal" WORKDIR /app -ARG PY_ARD_VERSION=1.0.3 +ARG PY_ARD_VERSION=1.0.4 COPY requirements.txt /app RUN pip install --no-cache-dir --upgrade pip && \ diff --git a/api-spec.yaml b/api-spec.yaml index f2a32eb..f565921 100644 --- a/api-spec.yaml +++ b/api-spec.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: ARD Reduction description: Reduce to ARD Level - version: "1.0.3" + version: "1.0.4" servers: - url: 'http://localhost:8080' tags: diff --git a/pyard/__init__.py b/pyard/__init__.py index aa55a01..09ea54a 100644 --- a/pyard/__init__.py +++ b/pyard/__init__.py @@ -27,7 +27,7 @@ from .misc import get_imgt_db_versions as db_versions __author__ = """NMDP Bioinformatics""" -__version__ = "1.0.3" +__version__ = "1.0.4" def init( diff --git a/setup.cfg b/setup.cfg index 8db6389..4d4adb7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.3 +current_version = 1.0.4 commit = True tag = True diff --git a/setup.py b/setup.py index 05cba6f..39edb12 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name="py-ard", - version="1.0.3", + version="1.0.4", description="ARD reduction for HLA with Python", long_description=readme, long_description_content_type="text/markdown",