-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protcur use orthauth, ver bump, update deps
- Loading branch information
Showing
4 changed files
with
28 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.0.2.dev0' | ||
__version__ = '0.0.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{'config-search-paths': ['{:user-config-path}/protcur/config.yaml',], | ||
'auth-variables': | ||
{'units-folder': {'environment-variables': 'PROTCUR_UNITS_FOLDER', | ||
'default': ['../../protc-lib/units', # git | ||
'../resources/units', # test sdist | ||
'{:user-data-path}/protcur/units', # pip install --user | ||
'{:prefix}/share/protcur/units', # system | ||
'/usr/share/protcur/units', # pypy3 | ||
'{:cwd}/share/protcur/units', # ebuild testing | ||
], | ||
}, | ||
'tags-folder-file': {'environment-variables': 'PROTCUR_TAGS_FOLDER_FILE', # NOTE you must provide path to the test file | ||
'default': ['../../protc-tags.rkt', # git | ||
'../resources/protc-tags.rkt', # test sdist | ||
'{:user-data-path}/protcur/protc-tags.rkt', # pip install --user | ||
'{:prefix}/share/protcur/protc-tags.rkt', # system | ||
'/usr/share/protcur/protc-tags.rkt', # pypy3 | ||
'{:cwd}/share/protcur/protc-tags.rkt', # ebuild testing | ||
], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,15 @@ | ||
import sys | ||
from pathlib import Path | ||
import appdirs | ||
import orthauth as oa | ||
|
||
__script_folder__ = Path(__file__).resolve().parent | ||
auth = oa.configure_relative('auth-config.py') | ||
|
||
# units | ||
__units_folder__ = Path(__script_folder__, '../../protc-lib/protc/units') | ||
|
||
if not __units_folder__.exists(): | ||
_attempts = [ | ||
Path(__script_folder__, '../resources/units'), | ||
Path(appdirs.user_data_dir(), 'protcur', 'units'), # pip install --user | ||
Path(sys.prefix, 'share', 'protcur', 'units'), | ||
Path('/usr', 'share', 'protcur', 'units'), # pypy3 | ||
Path('share', 'protcur', 'units'), # ebuild testing | ||
] | ||
for attempt in _attempts: | ||
if attempt.exists(): | ||
__units_folder__ = attempt | ||
break | ||
else: | ||
raise FileNotFoundError('no units folder was found at any of\n' | ||
f'{[__units_folder__] + _attempts}') | ||
|
||
__units_folder__ = auth.get_path('units-folder') | ||
__units_test_folder__ = __units_folder__ / 'test' | ||
__units_test_params__ = __units_test_folder__ / 'params.rkt' | ||
|
||
# tags | ||
__tags_folder__ = Path(__script_folder__, '../../.') | ||
if not (__tags_folder__ / 'protc-tags.rkt').exists(): | ||
_attempts = [ | ||
Path(__script_folder__, '../resources'), | ||
Path(appdirs.user_data_dir(), 'protcur'), # pip install --user | ||
Path(sys.prefix, 'share', 'protcur'), | ||
Path('/usr', 'share', 'protcur'), # pypy3 | ||
Path('share', 'protcur'), # ebuild testing | ||
] | ||
for attempt in _attempts: | ||
if (attempt / 'protc-tags.rkt').exists(): | ||
__tags_folder__ = attempt | ||
break | ||
else: | ||
raise FileNotFoundError('no tags folder was found at any of\n' | ||
f'{[__tags_folder__] + _attempts}') | ||
|
||
__tags_folder__ = auth.get_path('tags-folder-file').parent | ||
__anno_tags__ = __tags_folder__ / 'anno-tags.rkt' | ||
__protc_tags__ = __tags_folder__ / 'protc-tags.rkt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters