Skip to content

Commit

Permalink
[syftcli] rename src to syftcli
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgorana committed Aug 30, 2023
1 parent f03d145 commit 1db9b70
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cd-syftcli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ jobs:
if: ${{steps.get-hashes.outputs.current_hash != steps.get-hashes.outputs.previous_hash }}
id: bump-version
run: |
python3 src/syftcli/version.py
python3 syftcli/version.py
bump2version patch --allow-dirty --no-commit
tox -e lint || true
echo "deployed_version=$(python3 src/syftcli/version.py)" >> $GITHUB_OUTPUT
python3 src/syftcli/version.py
echo "deployed_version=$(python3 syftcli/version.py)" >> $GITHUB_OUTPUT
python3 syftcli/version.py
working-directory: ./packages/syftcli

- name: Write the new hash
Expand All @@ -90,7 +90,7 @@ jobs:
author_name: Madhava Jay
author_email: [email protected]
message: "bump version"
add: "['./packages/syftcli/.bumpversion.cfg','./packages/syftcli/setup.py','./packages/syftcli/src/syftcli/version.py', './scripts/syftcli_hash']"
add: "['./packages/syftcli/.bumpversion.cfg','./packages/syftcli/setup.py','./packages/syftcli/syftcli/version.py', './scripts/syftcli_hash']"
pull_strategy: NO-PULL

- name: Build and publish
Expand Down
4 changes: 3 additions & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ profile=black
force_single_line=True
known_syft=syft
known_grid=grid
known_syftcli=syftcli
known_first_party=src
remove_redundant_aliases=True
sections=FUTURE,STDLIB,THIRDPARTY,SYFT,GRID,FIRSTPARTY,LOCALFOLDER
sections=FUTURE,STDLIB,THIRDPARTY,SYFT,GRID,SYFTCLI,FIRSTPARTY,LOCALFOLDER
lines_between_types=0
force_sort_within_sections=True
import_heading_future=future
import_heading_stdlib=stdlib
import_heading_thirdparty=third party
import_heading_syft=syft absolute
import_heading_grid=grid absolute
import_heading_syftcli=syftcli absolute
import_heading_firstparty=first party
import_heading_localfolder=relative
ignore_comments=False
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ repos:
name: "absolufy-imports: syft-cli"
always_run: true
files: ^packages/syftcli
# This will ignore all src/**/*.py where relative imports are okay
# but absolufy only top-level src/<file>.py. where relative imports are not okay for pyinstaller
exclude: ^packages/syftcli/src/(.*)/
# This will ignore all syftcli/**/*.py where relative imports are okay
# but absolufy only top-level syftcli/<file>.py. where relative imports are not okay for pyinstaller
exclude: ^packages/syftcli/syftcli/(.*)/
args: ["--application-directories=packages/syftcli/"]

- repo: https://github.com/pycqa/isort
Expand Down
2 changes: 1 addition & 1 deletion packages/syftcli/.bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ tag_name = {new_version}
commit = True
commit_message = Bump version: {current_version} → {new_version}

[bumpversion:file:src/syftcli/version.py]
[bumpversion:file:syftcli/version.py]

[bumpversion:file:setup.py]
8 changes: 4 additions & 4 deletions packages/syftcli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
include_package_data=True,
entry_points={
"console_scripts": [
"syft = src.cli:app",
"syft-cli = src.cli:app",
"syftcli = src.cli:app",
"syftctl = src.cli:app",
"syft = syftcli.cli:app",
"syft-cli = syftcli.cli:app",
"syftcli = syftcli.cli:app",
"syftctl = syftcli.cli:app",
]
},
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from typer import Typer
from typer import echo

# first party
from src.bundle import cmd as bundle_cmd
from src.core.console import console
from src.version import __version__
# syftcli absolute
from syftcli.bundle import cmd as bundle_cmd
from syftcli.core.console import console
from syftcli.version import __version__

__all__ = "app"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/syftcli/tests/hello_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# third party
from typer.testing import CliRunner

# first party
from src.cli import app
# syftcli absolute
from syftcli.cli import app

runner = CliRunner()

Expand Down
4 changes: 2 additions & 2 deletions packages/syftcli/tests/version_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# third party
from typer.testing import CliRunner

# first party
from src.cli import app
# syftcli absolute
from syftcli.cli import app

runner = CliRunner()

Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ commands =
; Check if SYFT_CLI_VERSION is set or choosing the current version available
bash -c 'if [ -z $SYFT_CLI_VERSION ]; then \
echo "SYFT_CLI_VERSION is not set"; \
SYFT_CLI_VERSION=$(python3 src/syftcli/version.py); \
SYFT_CLI_VERSION=$(python3 syftcli/version.py); \
echo "Setting SYFT_CLI_VERSION to $SYFT_CLI_VERSION"; \
else \
echo "SYFT_CLI_VERSION is already set to $SYFT_CLI_VERSION"; \
Expand All @@ -121,11 +121,11 @@ commands =
echo "Building syftcli-$SYFT_CLI_VERSION for $OSTYPE" && \
if [[ "$OSTYPE" == "darwin"* ]]; then \
pyinstaller --clean --onefile --name syftcli-v$SYFT_CLI_VERSION-macos-universal2 --distpath ./dist/cli src/syftcli/cli.py --target-arch universal2; \
pyinstaller --clean --onefile --name syftcli-v$SYFT_CLI_VERSION-macos-universal2 --distpath ./dist/cli syftcli/cli.py --target-arch universal2; \
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then \
pyinstaller --clean --onefile --name syftcli-v$SYFT_CLI_VERSION-linux-x86_64 --distpath ./dist/cli src/syftcli/cli.py; \
pyinstaller --clean --onefile --name syftcli-v$SYFT_CLI_VERSION-linux-x86_64 --distpath ./dist/cli syftcli/cli.py; \
else \
pyinstaller --clean --onefile --name syftcli-v$SYFT_CLI_VERSION-windows-x86_64 --distpath ./dist/cli src/syftcli/cli.py; \
pyinstaller --clean --onefile --name syftcli-v$SYFT_CLI_VERSION-windows-x86_64 --distpath ./dist/cli syftcli/cli.py; \
fi'


Expand Down

0 comments on commit 1db9b70

Please sign in to comment.