Skip to content

Commit 4f6f76e

Browse files
committed
Fix username on docker (#271)
* When running without a login, `os.getlogin()` fails. Switch to using `getuser()` from `getpass` module. * Bump version: 1.0.3 → 1.0.4
1 parent 1487e44 commit 4f6f76e

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL MAINTAINER="Pradeep Bashyal"
44

55
WORKDIR /app
66

7-
ARG PY_ARD_VERSION=1.0.3
7+
ARG PY_ARD_VERSION=1.0.4
88

99
COPY requirements.txt /app
1010
RUN pip install --no-cache-dir --upgrade pip && \

api-spec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.3
22
info:
33
title: ARD Reduction
44
description: Reduce to ARD Level
5-
version: "1.0.3"
5+
version: "1.0.4"
66
servers:
77
- url: 'http://localhost:8080'
88
tags:

pyard/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from .misc import get_imgt_db_versions as db_versions
2828

2929
__author__ = """NMDP Bioinformatics"""
30-
__version__ = "1.0.3"
30+
__version__ = "1.0.4"
3131

3232

3333
def init(

pyard/misc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# > http://www.fsf.org/licensing/licenses/lgpl.html
2020
# > http://www.opensource.org/licenses/lgpl-license.php
2121
#
22-
import os
22+
import getpass
2323
import pathlib
2424
import tempfile
2525
from typing import List
@@ -143,7 +143,10 @@ def get_imgt_version(imgt_version):
143143

144144

145145
def get_default_db_directory():
146-
username = os.getlogin()
146+
try:
147+
username = getpass.getuser()
148+
except OSError:
149+
username = "nonuser"
147150
return pathlib.Path(tempfile.gettempdir()) / f"pyard-{username}"
148151

149152

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.3
2+
current_version = 1.0.4
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
setup(
3838
name="py-ard",
39-
version="1.0.3",
39+
version="1.0.4",
4040
description="ARD reduction for HLA with Python",
4141
long_description=readme,
4242
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)