Closed telamonian closed 6 years ago
There's still a bunch of issues to fix that relate to conflicts between how this project's files/paths are structured, and the way in which setup.py
and Python's setuptools
"want" those files/paths to be structured.
For example, right now if I try to run the program using the h5serv
command (the one that's set up by the newly fixed entry_points
in setup.py
), I get an error like:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/log/h5serv.log'
This is because the h5serv
command is installed as a script at /usr/local/h5serv
and h5serv defaults to saving the log file at a position relative to that script.
This makes sense. When I original setup the project I didn't think it was important to have a setup install script.
Do you plan to update the PR for the other issues?
Also the change breaks the travis tests. e.g.: https://travis-ci.org/HDFGroup/h5serv/jobs/437807772.
The travis script just needs to use the new name for invoking the server.
Do you plan to update the PR for the other issues?
Working on it right now!
Aside from the Travis setup, some import
statements in the tests are also broken by the changes, so I'll fix those too.
There's a bunch of tricky little problems relating to config
and how it's handled. Here's how I'm thinking to resolve the issues:
python app.py
h5serv
command, the current working directory will be used as the default data dir, log dir, etcI took a crack at fixing the remaining issues. At least some tests pass now. The remaining problems all have to do with how the tests... ah... "creatively leverage" the quirks of the Python import system to override h5serv.config
with their own local config
module. I know how to fix it, but I'll probably have to make a couple of significant changes to how config
works (at least internally).
Looks like the Travis tests are passing, that's a good sign. Are there remaining known problems with the PR?
Just needed some updates to the docs. The PR is now finished. Some notes:
setup.py
is totally fixed up, so as soon as you pull the changes and upload them to PyPI people should be able to install using pip install h5serv
. pip
, you can now run h5serv anywhere on a system using the h5serv
command.cd
ing to the root dir of the repo and then running python h5serv
. This was done by fixing up h5serv/__main__.py
, and replaces python h5serv/app.py
(which is no longer executable).
log
directory, and by default logs are now saved directly to the working directory.
FileNotFoundError
I described above./data
, /static
, etc) to the program's startup message, and/or optionally set up missing directories automatically.Let me know if you have any revisions @jreadey, or if the PR looks good to go!
I tried the PR with the h5pyd test suite, and everything worked fine. Merging into develop. Thanks for the contribution!
Fixes #102, fixes #122, and fixes #123
Here's my use case for h5serv: I'm writing an HDF5 file viewer plugin for another Python program, and I want to use h5serv as a dependency. Basically, h5serv will be used to handle all of the low-level interactions between the program and a user's HDF5 files. Two things need to happen in order to make this possible:
pip install h5serv
)from h5serv import app
), and there needs to be a way to use those components to start/stop an HDF5 server without actually having to spawn a new process.The code in this PR aims to fix all of the things preventing 1. and 2. from happening.