Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/bug fixes #308

Merged
merged 57 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
82e791b
add os runners to CI
RyanJField Jun 21, 2023
f4b1d6a
Fix symlink issue in common test
RyanJField Jun 22, 2023
fc855b2
Update dependencies
RyanJField Jun 22, 2023
7610d93
Use realpath for git root
RyanJField Jun 22, 2023
dad23e9
code smells
RyanJField Jun 23, 2023
089635b
Automaticall sync author prior to sync
RyanJField Jun 25, 2023
bc221fd
Merge branch 'hotfix/bugs' into hotfix/bug-fixes
RyanJField Jun 27, 2023
0d905d3
Fix tests / Dev Deps Updates
Jun 27, 2023
47d50f7
fix deploy
Jun 27, 2023
18d3c25
Fix testing for windows
Jun 29, 2023
fd2ae48
Window tempory named file fix for tests
Jun 29, 2023
1e829d3
Update tests for windows
Jun 30, 2023
b9ca06c
Clone into tempory directory
Jun 30, 2023
216c39f
Specify temporary directories
Jun 30, 2023
d9184d4
fix mkdir
Jun 30, 2023
2ba8578
update temp folder
Jun 30, 2023
c5c36c5
remove windows tests
Jun 30, 2023
3c83501
fix yaml
Jun 30, 2023
55e7266
Reimplement windows testing
Jul 1, 2023
28bf31c
Us if to cd
Jul 1, 2023
6c01266
fix dir
Jul 1, 2023
9ebef97
Use recursive
Jul 1, 2023
075b51a
fix if runner statement
Jul 1, 2023
f412a74
Fix workflow
Jul 1, 2023
566adfd
fix checkout
Jul 1, 2023
056733e
Fix module / MacOs Runner
Jul 1, 2023
846232b
Fix directories
Jul 1, 2023
9112949
remove redunant dependency, update lock file.
Jul 1, 2023
78ef36c
Checkout correct branch
Jul 1, 2023
dbb5065
fix checkout
Jul 1, 2023
223963f
Use bash
Jul 1, 2023
14fe6e8
fix orcid url issue
Jul 3, 2023
e072b03
fix orchid id issue
Jul 3, 2023
07f0d01
change CLI Inputs
Jul 3, 2023
a782d2e
Fix user_author on remote
Jul 4, 2023
9025970
Fix github name issues
Jul 4, 2023
e15488f
create user
Jul 4, 2023
0486f49
Fix Directory
Jul 4, 2023
41eafac
Export Drams Settings
Jul 4, 2023
5d6c04f
Use Create Superuser
Jul 4, 2023
8eb4008
fix typo
Jul 4, 2023
68d5728
Download file fix for local files
Jul 4, 2023
88426c5
Fix text
Jul 4, 2023
fed2131
Update Error
Jul 4, 2023
7389d1d
Add warning on error
Jul 4, 2023
b2d5c16
Tweak GH get
Jul 4, 2023
b595c3b
Update logger change get options
Jul 4, 2023
e6b3571
Disable verify warnings
Jul 5, 2023
bced904
Fix register data product
Jul 5, 2023
8d1c2c9
update deps
Jul 5, 2023
e84a0be
Fix register add tests
Jul 6, 2023
736fa81
Fix config test
Jul 6, 2023
f4480ba
Fix missing vairable
Jul 6, 2023
a39df9a
import warnings
Jul 6, 2023
9d6c3c8
add test_register increase sleep time, between retries
Jul 6, 2023
8c0c105
fix namespaces
Jul 6, 2023
6d3d74d
fix public, fix cache
Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ updates:
interval: "daily"
time: "00:00"
reviewers:
- "kzscisoft"
- "ryanjfield"
commit-message:
prefix: "pip"
include: "scope"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
permissions:
contents: write
jobs:
windows-py39:
windows-py3x:
name: Deploy Latest Windows Release
runs-on: windows-latest
steps:
Expand All @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.9.7'
python-version: '3.x'
architecture: "x64"

- name: Get Previous tag
Expand All @@ -42,7 +42,7 @@ jobs:
name: windows_faircli
path: dist/fair-cli-${{ steps.previoustag.outputs.tag }}-x64-windows-latest.exe

macos-py39:
macos-py3x:
name: Deploy Latest macOS Release
runs-on: macos-latest
steps:
Expand All @@ -52,7 +52,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.9.7'
python-version: '3.x'
architecture: "x64"

- name: Install Poetry
Expand All @@ -79,7 +79,7 @@ jobs:
path: dist/fair-cli-${{ steps.previoustag.outputs.tag }}-x64-macos-latest


ubuntu-py39:
ubuntu-py3x:
name: Deploy Latest Linux Release
runs-on: ubuntu-latest
steps:
Expand All @@ -89,7 +89,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.9.7'
python-version: '3.x'
architecture: "x64"

- name: Install Poetry
Expand Down Expand Up @@ -120,16 +120,16 @@ jobs:
name: Create Release
runs-on: ubuntu-latest
needs:
- ubuntu-py39
- macos-py39
- windows-py39
- ubuntu-py3x
- macos-py3x
- windows-py3x
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.9.7'
python-version: '3.x'
architecture: "x64"

- name: Install Poetry
Expand Down
40 changes: 30 additions & 10 deletions .github/workflows/fair-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,50 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] #, macos-latest, windows-latest]
# Issues with GitPython and Python >3.9.6, <3.10
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.8", "3.9", "3.10", "3.x"]
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
if: ${{ runner.os != 'Windows' }}
- name: Checkout to C windows
run: |
mkdir C:/FAIR-CLI
git clone https://github.com/FAIRDataPipeline/FAIR-CLI.git C:/FAIR-CLI
cd C:/FAIR-CLI
git checkout $GITHUB_REF_NAME
echo Github Ref: $GITHUB_REF_NAME
if: ${{ runner.os == 'Windows' }}
shell: bash
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: "x64"
- name: Install Required
run: sudo apt install libmemcached-dev
if: matrix.os == 'ubuntu-latest'
- name: Install Required
run: brew install memcached
if: matrix.os == 'macos-latest'
- name: Install Poetry
run: python -m pip install poetry
- name: Install Module
run: python -m poetry install
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd C:/FAIR-CLI
pwd
fi
python -m poetry install
shell: bash
- name: Install Python API for API Tests
run: python -m poetry run pip install git+https://github.com/FAIRDataPipeline/pyDataPipeline.git@dev
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd C:/FAIR-CLI
pwd
fi
python -m poetry run pip install git+https://github.com/FAIRDataPipeline/pyDataPipeline.git@main
shell: bash
- name: Run Tests for Each Marker
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd C:/FAIR-CLI
pwd
fi
for marker in $(poetry run pytest --markers | grep -oE "faircli_[a-zA-Z|_|0-9]+")
do
echo "Running tests for marker '$marker'"
Expand All @@ -41,6 +60,7 @@ jobs:
echo "ERROR: Tests for marker '$marker' failed"
fi
done
shell: bash
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/implementations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
${GITHUB_WORKSPACE}/registry-rem/scripts/start_fair_registry -p 8001 -s drams.test-remote-settings
# Copy the remote token
cp ${GITHUB_WORKSPACE}/registry-rem/token $PWD/token
export DJANGO_SETTINGS_MODULE=drams.test-remote-settings
${GITHUB_WORKSPACE}/registry-rem/venv/bin/python ${GITHUB_WORKSPACE}/registry-rem/manage.py createsuperuser --username FAIRDataPipeline --noinput
working-directory: pySimpleModel

- name: Install the registry and init
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ cython_debug/

# Misc
*.yaml
!tests/data/*.yaml
*.yml
token.txt
.fair
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ license: BSD-2-Clause
message: If you use this software, please cite it using these metadata.
repository-code: https://github.com/FAIRDataPipeline/FAIR-CLI/
title: "The FAIR Data Pipeline command line tool"
version: 0.7.3
version: 0.8.0
14 changes: 9 additions & 5 deletions fair/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ def status(verbose, debug) -> None:
except fdp_exc.FAIRCLIException as e:
e.err_print()
if e.level.lower() == "error":
if e.level.lower() == "error":
sys.exit(e.exit_code)
sys.exit(e.exit_code)

@cli.group(invoke_without_command=True)
@click.option("--debug/--no-debug", help="Run in debug mode", default=False)
Expand All @@ -118,8 +117,10 @@ def list(ctx, debug, remote) -> None:
ctx.obj = {}
ctx.obj['DEBUG'] = debug
ctx.obj['REMOTE'] = remote
ctx.invoke(data_products)
ctx.invoke(code_runs)
_current_args = " ".join(sys.argv)
if not ("data-products" in _current_args or "code-runs" in _current_args):
ctx.invoke(data_products)
ctx.invoke(code_runs)

@list.command()
@click.pass_context
Expand Down Expand Up @@ -161,7 +162,7 @@ def create(debug, output: str) -> None:
if output
else os.path.join(os.getcwd(), fdp_com.USER_CONFIG_FILE)
)
click.echo(f"Generating new user configuration file" f" '{output}'")
click.echo(f"Generating new user configuration file '{output}'")
with fdp_session.FAIR(os.getcwd(), debug=debug) as fair_session:
fair_session.make_starter_config(output)

Expand Down Expand Up @@ -527,6 +528,7 @@ def run(
):
"""Initialises a job with the option to specify a bash command"""
# Allow no config to be specified, if that is the case use default local
click.echo("Running run please wait")
config = config[0] if config else fdp_com.local_user_config(os.getcwd())
try:
with fdp_session.FAIR(
Expand Down Expand Up @@ -636,6 +638,7 @@ def modify(ctx, label: str, url: str, debug: bool) -> None:
)
def push(remote: str, debug: bool, dirty: bool):
"""Push data between the local and remote registry"""
click.echo("Running push please wait")
remote = remote[0] if remote else "origin"
try:
with fdp_session.FAIR(
Expand Down Expand Up @@ -679,6 +682,7 @@ def config_email(user_email: str) -> None:
)
def pull(config: str, debug: bool, local: bool):
"""Update local registry from remotes and sources"""
click.echo("Running pull please wait")
config = config[0] if config else fdp_com.local_user_config(os.getcwd())
try:
with fdp_session.FAIR(
Expand Down
9 changes: 8 additions & 1 deletion fair/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,11 @@ def set_file_permissions(path: str):
for dir in [os.path.join(root,d) for d in dirs]:
os.chmod(dir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
for file in [os.path.join(root, f) for f in files]:
os.chmod(file, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
os.chmod(file, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)

def remove_readonly(fn, path, excinfo):
try:
os.chmod(path, stat.S_IWRITE)
fn(path)
except Exception as exc:
print("Skipped:", path, "because:\n", exc)