Open himanshub16 opened 6 years ago
How do you handle the common validator_asserts.json
file?
I think I can work with a symlink approach. Will cause issues with Windows probably, though, but I don't think any contributor so far is using that.
Another solution could be not having data files in git.
The respective module (in any language) would download the database on the first run and use that copy for subsequent calls.
There can be separate releases for ifsc.json
and validator_asserts.json
(i.e. data files) avoiding need of any symlinks or cross-package dependency in codebase or rebuilding release packages on json update.
Don't know if this is a perfect solution or if this is actually an issue (if someone else is facing it)!
I don't know how go manages dependency releases. For npm, rubygems, PHP, hex - it either downloads the final release (compressed) or just the tag from GitHub (which means no previous files).
Does go download the entire git history if you are using a specific tag?
validator.json
is just a common tests file. We can keep validator_asserts.json
in the data directory and then symlink it to the right lang/tests
directories.
Apologies about the issues, but one of my goals for the repo was to see how far I could take the one-repo-for-all-packages concept (reduces maintenance burden on all contributors and everything remains updated).
@himanshub16 I can try pushing out this directory refactor this weekeend if that helps.
Thanks for contributing :+1:
go get
(analogous to npm install
) actually gets the git repo when fetching remote packages. > documentation
I have been trying to implement Python version and Golang version for the same.
Here are some of the problems I faced:
setup.py
for Python, a lot of time was consumed to handle relative paths forIFSC.json
.setup.py
in the root is that the resultingbuild/egg
afterpython setup.py build
has the source file atsrc/python/ifsc.py
instead of justifsc.py
.tests
being in/tests
requires importing source files using the relative path. This works for languages like JavaScript but causes problems when writing tests forpython
andgolang
.IFSC.json
is updated.A proposed solution would be to have following directory structure:
This would bring more segregation among language-specific modules where the language enforces a specific construct on the directory structure.
Solution for
IFSC.json
Provide
IFSC.json
as a symlink to each language's directory. This will avoid duplicates and help language specific files local to a directory while building.