Skip to content

Commit

Permalink
chg: dev: refactor/update dependencies, cleanup tests and tox
Browse files Browse the repository at this point in the history
* appdirs => platformdirs, minor refactor, daemonizer => 0.4.0

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
  • Loading branch information
sarnold committed Sep 20, 2023
1 parent 929521d commit 38f5f2c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# daemon requirements, useful for tox/pip
daemonizer @ git+https://github.com/sarnold/python-daemonizer.git@0.3.5#5f6bc3c80a90344b2c8e4cc24ed0b8c098a7af50; platform_system!="Windows"
daemonizer @ git+https://github.com/sarnold/python-daemonizer.git@0.4.0#5e0fd72b9176fdcda8c9386f8b0905f2c434b61f; platform_system!="Windows"
tftpy @ git+https://github.com/VCTLabs/tftpy.git@0.8.2.1#58d1f5c60af2e3759fbb137b89816954d8ea6bc9
appdirs
platformdirs
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ keywords =
[options]
python_requires = >= 3.6
install_requires =
appdirs
daemonizer @ git+https://github.com/sarnold/python-daemonizer.git@0.3.5#5f6bc3c80a90344b2c8e4cc24ed0b8c098a7af50
daemonizer @ git+https://github.com/sarnold/python-daemonizer.git@0.4.0#5e0fd72b9176fdcda8c9386f8b0905f2c434b61f
platformdirs
tftpy @ git+https://github.com/VCTLabs/tftpy.git@0.8.2.1#58d1f5c60af2e3759fbb137b89816954d8ea6bc9

packages = find_namespace:
Expand Down
8 changes: 4 additions & 4 deletions src/pyserv/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
from pathlib import Path

from appdirs import AppDirs
from platformdirs import PlatformDirs

from ._version import __version__ as version

Expand All @@ -17,9 +17,9 @@ def get_userdirs():
:return tuple: logdir, piddir, docdir as Path objs
"""
dirs = AppDirs(appname='pyserv', version=version)
logdir = Path(dirs.user_log_dir)
piddir = Path(dirs.user_cache_dir).joinpath('run')
dirs = PlatformDirs(appname='pyserv', appauthor='nerdboy')
logdir = dirs.user_log_path
piddir = dirs.user_runtime_path
docdir = Path(os.getcwd())
return logdir, piddir, docdir

Expand Down
4 changes: 2 additions & 2 deletions tests/test_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def test_get_userdirs():
if WIN32:
assert logdir.name == 'Logs'
elif APPLE:
assert logdir.name == version
assert logdir.name == 'pyserv'
else:
assert logdir.name == 'log'

assert piddir.name == 'run'
assert piddir.name == 'pyserv'
assert docdir.name == Path.cwd().name


Expand Down
1 change: 0 additions & 1 deletion tests/test_serv.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
iface = '127.0.0.1'
port = 8000
wport = 5000
tport = 8069


def get_request(port, iface):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ commands =
tail -n {env:TAIL} {env:LOG}
cmp {env:TST_FILE} tests/{env:TST_FILE}
ls -l {env:TST_FILE} tests/{env:TST_FILE}
bash -c 'rm -f $TST_FILE tests/$TST_FILE'
bash -c 'rm -f {env:TST_FILE} tests/{env:TST_FILE}'

commands_post =
tftpdaemon stop
Expand Down

0 comments on commit 38f5f2c

Please sign in to comment.