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

Windows support for Lydia docker #60

Merged
merged 4 commits into from
Jun 6, 2023
Merged

Conversation

gallorob
Copy link
Contributor

Proposed changes

Workaround to find the Lydia docker from Windows' IDEs (such as Pycharm).

Fixes

Fixes the FileNotFound error when looking for the Lydia executable.

Types of changes

  • Bugfix

Checklist

  • I have read the CONTRIBUTING doc
  • I have tested the changes of my contribution

Further comments

Encountered bug while working on the exam's project.

@@ -32,7 +32,7 @@

def call_lydia(*args) -> str:
"""Call the Lydia CLI tool with the arguments provided."""
command = ["lydia", *args]
command = ["lydia" if sys.platform == "win32" else "lydia.bat", *args]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to avoid the .bat extension on Windows, and still make the script foundable by the OS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would simplify the code as it would not need the if condition.

Copy link
Member

@marcofavorito marcofavorito Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, sys not imported! Please address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the sys import and corrected the check.
Regarding the file extension, Windows executes by default .bats, .coms and .exes. These extension are in the PATHEXT environment variable. The proposed solution requires the least configuration by the user and introduces just one if condition, which I believe is a good tradeoff.

Copy link
Member

@marcofavorito marcofavorito Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Thanks!

Copy link
Member

@marcofavorito marcofavorito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Just a comment. We adopt the "Git Workflow" convention to make PR on develop rather than main, as in main only release commits are allowed. This change will be added for the next release.

Once merged on branch whitemech:develop, the package can then be installed via:

pip install git+https://github.com/whitemech/logaut.git@develop#egg=logaut

@marcofavorito
Copy link
Member

ltlf2dfa tests are broken, but lydia tests should pass

@marcofavorito
Copy link
Member

@gallorob please, can you also run make lint-all locally? It seems isort checks are failing. Also make isort should work, but make lint-all should cover most of the CI checks.

README.md Outdated Show resolved Hide resolved
@marcofavorito marcofavorito changed the base branch from main to develop June 21, 2021 16:31
Co-authored-by: Marco Favorito <marco.favorito@gmail.com>
@marcofavorito marcofavorito changed the base branch from develop to main June 5, 2023 17:33
@marcofavorito
Copy link
Member

Merging since I cannot do changes directly on gallorob:main and to keep authorship of the commits. Thank you again @gallorob !

@marcofavorito marcofavorito merged commit bbf863c into whitemech:main Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants