Skip to content

Commit

Permalink
Merge pull request #43 from FAST-HEP/BK_remove_xrootd_glob
Browse files Browse the repository at this point in the history
Remove xrootd glob
  • Loading branch information
benkrikler authored Apr 17, 2020
2 parents ee6dd32 + 8661e98 commit 887d7e9
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 78 deletions.
1 change: 1 addition & 0 deletions .requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pytest==4.5.0
pytest-cov==2.7.1
pytest-runner==4.4
codecov==2.0.15
xrootd>=4.10.0
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,26 @@ python:
- "3.7"

install:
- sudo apt-get update
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_PYTHON_VERSION" == 3.[678]* ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
source "$HOME/miniconda/etc/profile.d/conda.sh";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a;

conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION;
conda activate test-environment;
conda install -c conda-forge xrootd;
fi
- pip install -r .requirements_dev.txt
- pip install .


script: pytest -v --doctest-modules --cov-report=xml --cov=fast_curator tests/

after_success:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
### Removed

## [0.6.0] - 2020-04-17
### Changed
- Use Xrootd's implementation of xrootd_glob not our own version PR #43 [@benkrikler](https://github.com/benkrikler)

## [0.5.0] - 2020-01-27
### Added
- Support for handling files which can't be opened PR #36 [@seriksen](https://github.com/seriksen)
Expand Down
16 changes: 11 additions & 5 deletions fast_curator/catalogues/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import os
import sys
import uproot
from collections import defaultdict, Counter
from functools import partial
if sys.version[0] > '2':
from urllib.parse import urlparse
else:
from urlparse import urlparse


class XrootdExpander():
"""
Expand wild-carded file paths, including with xrootd-served files
"""
from .. import xrootd_glob

@staticmethod
def expand_file_list(files, prefix=None):
glob = XrootdExpander.xrootd_glob.glob
return expand_file_list_generic(files, prefix, glob=glob)
from XRootD.client.glob_funcs import glob
return expand_file_list_generic(files, prefix,
glob=partial(glob, raise_error=True))

@staticmethod
def check_files(*args, **kwargs):
Expand All @@ -38,7 +43,8 @@ def check_files(*args, **kwargs):
def expand_file_list_generic(files, prefix, glob):
full_list = []
for name in files:
if not os.path.isabs(name):
scheme = urlparse(name).scheme
if not scheme and not os.path.isabs(name):
if prefix:
name = os.path.join(prefix, name)
else:
Expand Down
2 changes: 1 addition & 1 deletion fast_curator/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ def split_version(version):
return tuple(result)


__version__ = '0.5.0'
__version__ = '0.6.0'
version_info = split_version(__version__) # noqa
70 changes: 0 additions & 70 deletions fast_curator/xrootd_glob.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.0
current_version = 0.6.0
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_version():

setup_requirements = ['pytest-runner', ]

test_requirements = ['pytest', 'flake8', 'pytest-cov']
test_requirements = ['pytest', 'flake8', 'pytest-cov', 'xrootd']

setup(
author="F.A.S.T",
Expand Down

0 comments on commit 887d7e9

Please sign in to comment.