Skip to content

Commit

Permalink
Use pyargs instead of mod_dpath hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Jan 6, 2022
1 parent 25324ce commit b9ac0ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exclude_lines =
.*sys.version_info[0] == 2:

omit =
ubelt/tests/*
ubelt/_win32_links.py
ubelt/__main__.py
*ubelt/tests/*
*ubelt/_win32_links.py
*ubelt/__main__.py
*/setup.py
12 changes: 3 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ jobs:
ls -al
# Run the tests
# Get path to installed package
MOD_DPATH=$(python -c "import ubelt, os; print(os.path.dirname(ubelt.__file__))")
echo "MOD_DPATH = $MOD_DPATH"
python -m pytest --xdoctest --cov=ubelt $MOD_DPATH ./tests
python -m pytest --xdoctest --cov=ubelt ./tests --pyargs ubelt
- name: Test full sdist
run: |
Expand All @@ -75,9 +73,7 @@ jobs:
python -m pip install -r requirements/optional.txt
# Run the tests
# Get path to installed package
MOD_DPATH=$(python -c "import ubelt, os; print(os.path.dirname(ubelt.__file__))")
echo "MOD_DPATH = $MOD_DPATH"
python -m pytest --xdoctest $MOD_DPATH ./tests
python -m pytest --xdoctest ./tests --pyargs ubelt
- name: Upload sdist artifact
Expand Down Expand Up @@ -196,9 +192,7 @@ jobs:
cd $WORKSPACE_DNAME
# Run the tests
# Get path to installed package
MOD_DPATH=$(python -c "import ubelt, os; print(os.path.dirname(ubelt.__file__))")
echo "MOD_DPATH = $MOD_DPATH"
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../.coveragerc --cov-report term --cov=ubelt $MOD_DPATH ../tests
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../.coveragerc --cov-report term --cov=ubelt ../tests --pyargs ubelt
mv .coverage "../.coverage.$WORKSPACE_DNAME"
cd ..
# Move coverage file to a new name
Expand Down
2 changes: 1 addition & 1 deletion requirements/runtime.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jaraco.windows>=3.9.1;platform_system=="Windows"
typing>=3.7.4;python_version<='2.7'
# future>=0.18.2;python_version<='2.7'
futures>=3.3.0;python_version<='2.7'
pathlib>=1.0.1;python_version<='2.7'
pathlib2>=1.0.1;python_version<='2.7'
2 changes: 1 addition & 1 deletion ubelt/util_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def delete(self):
>>> dpath1.delete()
>>> assert not any(p.exists() for p in [dpath1, fpath1, fpath2])
"""
if PY_LE_35:
if PY_LE_35: # nocover
util_io.delete(str(self))
else:
util_io.delete(self)
Expand Down

0 comments on commit b9ac0ff

Please sign in to comment.