-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from deepghs/fix/path
dev(narugo): fix path issues
- Loading branch information
Showing
13 changed files
with
1,112 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#file: noinspection YAMLSchemaValidation | ||
name: Irregular Repos | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 * * * 0' | ||
|
||
jobs: | ||
check_irregular_repo: | ||
name: Check Repos | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- 'ubuntu-latest' | ||
python-version: | ||
- '3.8' | ||
|
||
steps: | ||
- name: Get system version for Linux | ||
if: ${{ contains(matrix.os, 'ubuntu') }} | ||
shell: bash | ||
run: | | ||
echo "OS_NAME=Linux" >> $GITHUB_ENV | ||
echo "IS_WIN=" >> $GITHUB_ENV | ||
echo "IS_MAC=" >> $GITHUB_ENV | ||
- name: Get system version for Windows | ||
if: ${{ contains(matrix.os, 'windows') }} | ||
shell: bash | ||
run: | | ||
echo "OS_NAME=Windows" >> $GITHUB_ENV | ||
echo "IS_WIN=1" >> $GITHUB_ENV | ||
echo "IS_MAC=" >> $GITHUB_ENV | ||
- name: Get system version for MacOS | ||
if: ${{ contains(matrix.os, 'macos') }} | ||
shell: bash | ||
run: | | ||
echo "OS_NAME=MacOS" >> $GITHUB_ENV | ||
echo "IS_WIN=" >> $GITHUB_ENV | ||
echo "IS_MAC=1" >> $GITHUB_ENV | ||
- name: Set environment for Cpython | ||
if: ${{ !contains(matrix.python-version, 'pypy') }} | ||
shell: bash | ||
run: | | ||
echo "IS_PYPY=" >> $GITHUB_ENV | ||
- name: Set environment for PyPy | ||
if: ${{ contains(matrix.python-version, 'pypy') }} | ||
shell: bash | ||
run: | | ||
echo "IS_PYPY=1" >> $GITHUB_ENV | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 20 | ||
submodules: 'recursive' | ||
- name: Set up system dependences on Linux | ||
if: ${{ env.OS_NAME == 'Linux' }} | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y tree cloc wget curl make zip | ||
sudo apt-get install -y git-lfs | ||
sudo apt-get install p7zip-full rar unrar | ||
- name: Set up system dependences on Windows | ||
if: ${{ env.OS_NAME == 'Windows' }} | ||
shell: bash | ||
run: | | ||
choco install tree cloc wget curl make zip | ||
choco install 7zip winrar # unrar should be added | ||
- name: Set up system dependences on MacOS | ||
if: ${{ env.OS_NAME == 'MacOS' }} | ||
run: | | ||
brew install tree cloc wget curl make zip | ||
brew install sevenzip | ||
brew install --cask rar | ||
- name: Set up python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade flake8 setuptools wheel twine | ||
pip install -r requirements.txt | ||
pip install -r requirements-test.txt | ||
- name: Test the basic environment | ||
shell: bash | ||
run: | | ||
python -V | ||
pip --version | ||
pip list | ||
tree . | ||
cloc hfutils | ||
cloc test | ||
- name: Run unittest | ||
env: | ||
CI: 'true' | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
shell: bash | ||
run: | | ||
python -m tools.irregular_repo | ||
- name: Change Commit | ||
id: commit | ||
run: | | ||
git config user.name 'narugo1992' | ||
git config user.email '[email protected]' | ||
git add -A | ||
git diff-index --quiet HEAD || git commit -a -m "dev(narugo): auto sync irregular repositories $(date -R)" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} |
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 |
---|---|---|
|
@@ -1223,4 +1223,5 @@ fabric.properties | |
*.pt | ||
/runs | ||
/YOLOv8 | ||
.benchmarks | ||
.benchmarks | ||
!/hfutils/utils/irregular_repo.json |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ hfutils.utils | |
|
||
binary | ||
download | ||
path | ||
tqdm_ | ||
walk | ||
|
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,36 @@ | ||
hfutils.utils.path | ||
================================= | ||
|
||
.. currentmodule:: hfutils.utils.path | ||
|
||
.. automodule:: hfutils.utils.path | ||
|
||
|
||
hf_normpath | ||
-------------------------------------------- | ||
|
||
.. autofunction:: hf_normpath | ||
|
||
|
||
|
||
hf_fs_path | ||
-------------------------------------------- | ||
|
||
.. autofunction:: hf_fs_path | ||
|
||
|
||
|
||
parse_hf_fs_path | ||
-------------------------------------------- | ||
|
||
.. autofunction:: parse_hf_fs_path | ||
|
||
|
||
|
||
HfFileSystemPath | ||
-------------------------------------------- | ||
|
||
.. autoclass:: HfFileSystemPath | ||
|
||
|
||
|
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
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,6 +1,6 @@ | ||
from .binary import is_binary_file | ||
from .download import download_file | ||
from .path import hf_normpath | ||
from .path import hf_normpath, hf_fs_path, parse_hf_fs_path, HfFileSystemPath | ||
from .temp import TemporaryDirectory | ||
from .tqdm_ import tqdm | ||
from .walk import walk_files |
Oops, something went wrong.