Skip to content

Commit

Permalink
Merge pull request #433 from ESSS/fb-ASIM-5901_review_sdk_workflow
Browse files Browse the repository at this point in the history
Review sdk workflow
  • Loading branch information
ThalesCarl authored Feb 28, 2025
2 parents 1b7ebc7 + 41fa10e commit d45d21f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.10"]
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/alfacase/case_description.quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ From a terminal, and inside a virtual environment, update pip:

Install the |sdk| with:

>>> pip install alfasim-sdk
>>> python -m pip install alfasim-sdk

.. note::

Expand Down
2 changes: 1 addition & 1 deletion docs/source/plugins/01_quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ the official docs <https://www.python.org/downloads/>`_.
>>> conda create -n sdk_env
>>> conda activate sdk_env
>>> pip install alfasim-sdk
>>> python -m pip install alfasim-sdk
Alternatively, an ``environment.yml`` can be added to your project and ``alfasim-sdk`` can be declared at ``pip`` dependencies.

Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ classifiers =
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10

[options.entry_points]
Expand All @@ -30,7 +28,7 @@ package_dir =
=src
include_package_data = True

python_requires = >=3.8
python_requires = >=3.10
zip_safe = no
setup_requires =
setuptools>=40.0
Expand Down
1 change: 1 addition & 0 deletions src/alfasim_sdk/_internal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def new(dst, caption, plugin_id, author_name, author_email):
+---assets
| plugin.yaml
| README.md
| CHANGELOG.rst
|
\---src
| CMakeLists.txt
Expand Down
12 changes: 8 additions & 4 deletions src/alfasim_sdk/default_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ def compile(ctx, cmake_extra_args="", debug=False, clean=False):
print_message(f"cmake args = {cmake_args}", color=Fore.YELLOW, bright=True)

cmake_cmd = shutil.which("cmake")
if cmake_cmd is None:
msg = "Cmake is not available. Please install at least version 3.5.2 to compile the plugin"
raise Exit(message=msg, code=1)

subprocess.check_call([f"{cmake_cmd}"] + cmake_args)
subprocess.check_call(
[
Expand Down Expand Up @@ -325,15 +329,15 @@ def install_plugin(ctx, install_dir=None):
plugin_folder = Path(ctx.config._project_prefix)
plugin_id = plugin_folder.name

try:
hm_plugin_path = next(plugin_folder.glob("*.hmplugin"))
except StopIteration:
hm_plugins_files = list(plugin_folder.glob("*.hmplugin"))
if len(hm_plugins_files) != 1:
print_message(
f"Could not find any '*.hmplugin' in {plugin_folder}.",
f"None or more than one '*.hmplugin' found in {plugin_folder}. Currently, this task only install the plugin if there is just one .hmplugin in the plugin folder.",
color=Fore.RED,
bright=True,
)
raise Exit(code=1)
hm_plugin_path = hm_plugins_files[0]

if not hm_plugin_path.is_file():
print_message(
Expand Down
3 changes: 2 additions & 1 deletion tests/test_invoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def get_plugin_installed_files(
artifacts_dir / f"{plugin_id}.py",
assets_dir / "plugin.yaml",
assets_dir / "README.md",
assets_dir / "CHANGELOG.rst",
]
return expected_files

Expand Down Expand Up @@ -298,7 +299,7 @@ def test_install_plugin_missing_plugin(new_plugin_dir: Path, monkeypatch: Monkey
stderr=subprocess.STDOUT,
)

error_message_chunk = "Could not find any '*.hmplugin'"
error_message_chunk = "None or more than one '*.hmplugin' found"
assert result.returncode == 1
assert error_message_chunk in result.stdout.decode("utf-8")

Expand Down

0 comments on commit d45d21f

Please sign in to comment.