Skip to content

Commit 611a150

Browse files
author
Filip Richtarik
committed
init
1 parent f7f6446 commit 611a150

4 files changed

Lines changed: 47 additions & 14 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# tag push, getting e.g. (for sister repo scantree) scantree-0+untagged.1.gd74b1d5,
2323
# see: https://github.com/andhus/scantree/actions/runs/7485873305/job/20375116541#step:7:42)
2424
- name: Set up Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: "3.x"
2828
- name: Install pypa/build
@@ -34,7 +34,7 @@ jobs:
3434
- name: Build a binary wheel and a source tarball
3535
run: python3 -m build
3636
- name: Store the distribution packages
37-
uses: actions/upload-artifact@v3
37+
uses: actions/upload-artifact@v4
3838
with:
3939
name: python-package-distributions
4040
path: dist/
@@ -54,7 +54,7 @@ jobs:
5454

5555
steps:
5656
- name: Download all the dists
57-
uses: actions/download-artifact@v3
57+
uses: actions/download-artifact@v4
5858
with:
5959
name: python-package-distributions
6060
path: dist/
@@ -73,12 +73,12 @@ jobs:
7373

7474
steps:
7575
- name: Download all the dists
76-
uses: actions/download-artifact@v3
76+
uses: actions/download-artifact@v4
7777
with:
7878
name: python-package-distributions
7979
path: dist/
8080
- name: Sign the dists with Sigstore
81-
uses: sigstore/gh-action-sigstore-python@v1.2.3
81+
uses: sigstore/gh-action-sigstore-python@v2.1.1
8282
with:
8383
inputs: >-
8484
./dist/*.tar.gz
@@ -118,7 +118,7 @@ jobs:
118118

119119
steps:
120120
- name: Download all the dists
121-
uses: actions/download-artifact@v3
121+
uses: actions/download-artifact@v4
122122
with:
123123
name: python-package-distributions
124124
path: dist/

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
key: ${{ runner.os }}-${{ matrix.python-version }}-tox-${{ hashFiles('setup.py') }}-${{ hashFiles('setup.cfg') }} }}
4242
- name: Test with tox
4343
run: tox
44-
- uses: codecov/codecov-action@v3
44+
- uses: codecov/codecov-action@v4
4545
with:
4646
token: ${{ secrets.CODECOV_TOKEN }}
4747
verbose: true

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
author="Anders Huss",
2626
author_email="andhus@kth.se",
2727
license='MIT',
28-
install_requires=['scantree>=0.0.2', 'pathspec<0.10.0'],
28+
install_requires=['scantree>=0.0.2'],
2929
packages=find_packages('src'),
3030
package_dir={'': 'src'},
3131
include_package_data=True,

tests/test_dirhash.py

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_get_available(self):
5151
print(f"Failed to create hasher for {algorithm}: {exc}")
5252
assert exc.args[0] == f"unsupported hash type {algorithm}"
5353
hasher = None
54-
54+
5555
if hasher is not None:
5656
assert hasattr(hasher, 'update')
5757
assert hasattr(hasher, 'hexdigest')
@@ -267,7 +267,7 @@ def test_cyclic_link(self):
267267
with pytest.raises(SymlinkRecursionError):
268268
filepaths = included_paths(self.path_to('root'))
269269

270-
def test_ignore_hidden_files(self):
270+
def test_ignore_hidden(self):
271271
self.mkdirs('root/d1')
272272
self.mkdirs('root/.d2')
273273

@@ -282,12 +282,45 @@ def test_ignore_hidden_files(self):
282282
assert filepaths == ['.d2/f1', '.f2', 'd1/.f2', 'd1/f1', 'f1']
283283

284284
# with ignore
285-
filepaths = included_paths(
286-
self.path_to('root'),
287-
match=['*', '!.*']
288-
)
285+
filepaths = included_paths(self.path_to('root'), match=['*', '!.*'])
286+
assert filepaths == ['d1/f1', 'f1']
287+
288+
def test_ignore_hidden_files_only(self):
289+
self.mkdirs('root/d1')
290+
self.mkdirs('root/.d2')
291+
292+
self.mkfile('root/f1')
293+
self.mkfile('root/.f2')
294+
self.mkfile('root/d1/f1')
295+
self.mkfile('root/d1/.f2')
296+
self.mkfile('root/.d2/f1')
297+
298+
# no ignore
299+
filepaths = included_paths(self.path_to('root'))
300+
assert filepaths == ['.d2/f1', '.f2', 'd1/.f2', 'd1/f1', 'f1']
301+
302+
# with ignore
303+
filepaths = included_paths(self.path_to('root'), match=['**/*', '!**/.*', '**/.*/*', '!**/.*/.*'])
289304
assert filepaths == ['.d2/f1', 'd1/f1', 'f1']
290305

306+
def test_ignore_hidden_explicitly_recursive(self):
307+
self.mkdirs('root/d1')
308+
self.mkdirs('root/.d2')
309+
310+
self.mkfile('root/f1')
311+
self.mkfile('root/.f2')
312+
self.mkfile('root/d1/f1')
313+
self.mkfile('root/d1/.f2')
314+
self.mkfile('root/.d2/f1')
315+
316+
# no ignore
317+
filepaths = included_paths(self.path_to('root'))
318+
assert filepaths == ['.d2/f1', '.f2', 'd1/.f2', 'd1/f1', 'f1']
319+
320+
# with ignore
321+
filepaths = included_paths(self.path_to('root'), match=['*', '!**/.*'])
322+
assert filepaths == ['d1/f1', 'f1']
323+
291324
def test_exclude_hidden_dirs(self):
292325
self.mkdirs('root/d1')
293326
self.mkdirs('root/.d2')

0 commit comments

Comments
 (0)