-
Notifications
You must be signed in to change notification settings - Fork 38
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
Unable to correctly loading the methods from relatively imported classes #365
Comments
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 3, 2024
Correctly loading the methods from relatively imported classes (getgauge#365) Signed-off-by: Kunal Vishwasrao <[email protected]> Co-authored-by: Zabil Cheriya Maliackal <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 3, 2024
…uge#365) Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 3, 2024
Correctly loading the methods from relatively imported classes (getgauge#365) Signed-off-by: Kunal Vishwasrao <[email protected]> Co-authored-by: Zabil Cheriya Maliackal <[email protected]> Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 4, 2024
…gauge#365) Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 4, 2024
Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 4, 2024
Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 4, 2024
Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 4, 2024
Signed-off-by: Kunal Vishwasrao <[email protected]>
kunalvishwasrao
added a commit
to kunalvishwasrao/gauge-python
that referenced
this issue
Jul 5, 2024
Signed-off-by: Kunal Vishwasrao <[email protected]>
zabil
added a commit
that referenced
this issue
Jul 6, 2024
* Bump the pip-dependencies group with 2 updates (#358) Bumps the pip-dependencies group with 2 updates: [importlib-metadata](https://github.com/python/importlib_metadata) and [setuptools](https://github.com/pypa/setuptools). Updates `importlib-metadata` from 7.1.0 to 7.2.1 - [Release notes](https://github.com/python/importlib_metadata/releases) - [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst) - [Commits](python/importlib_metadata@v7.1.0...v7.2.1) Updates `setuptools` from 70.0.0 to 70.1.0 - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](pypa/setuptools@v70.0.0...v70.1.0) --- updated-dependencies: - dependency-name: importlib-metadata dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip-dependencies - dependency-name: setuptools dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Kunal Vishwasrao <[email protected]> * Bump the pip-dependencies group across 1 directory with 3 updates (#362) Bumps the pip-dependencies group with 3 updates in the / directory: [debugpy](https://github.com/microsoft/debugpy), [importlib-metadata](https://github.com/python/importlib_metadata) and [setuptools](https://github.com/pypa/setuptools). Updates `debugpy` from 1.8.1 to 1.8.2 - [Release notes](https://github.com/microsoft/debugpy/releases) - [Commits](microsoft/debugpy@v1.8.1...v1.8.2) Updates `importlib-metadata` from 7.2.1 to 8.0.0 - [Release notes](https://github.com/python/importlib_metadata/releases) - [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst) - [Commits](python/importlib_metadata@v7.2.1...v8.0.0) Updates `setuptools` from 70.1.0 to 70.1.1 - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](pypa/setuptools@v70.1.0...v70.1.1) --- updated-dependencies: - dependency-name: debugpy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip-dependencies - dependency-name: importlib-metadata dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip-dependencies - dependency-name: setuptools dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Kunal Vishwasrao <[email protected]> * Support for relative imports to reuse step impls Signed-off-by: Kunal Vishwasrao <[email protected]> * Update release dependencies Signed-off-by: BugDiver <[email protected]> Signed-off-by: Kunal Vishwasrao <[email protected]> * Correctly loading the methods from relatively imported classs (addition to #360) Signed-off-by: Kunal Vishwasrao <[email protected]> * Update getgauge/impl_loader.py Correctly loading the methods from relatively imported classes (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> Co-authored-by: Zabil Cheriya Maliackal <[email protected]> Signed-off-by: Kunal Vishwasrao <[email protected]> * Returning method_list in update_step_resgistry_with_class method (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> * Adding test class for relative import unittest (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> * Adding unittest for relative import (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> * Renaming method to update_step_registry_with_class (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> * Updating unittest for impl loader (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> * Bumping up python package version (#365) Signed-off-by: Kunal Vishwasrao <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Kunal Vishwasrao <[email protected]> Signed-off-by: BugDiver <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vinay Shukla <[email protected]> Co-authored-by: Zabil Cheriya Maliackal <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
After merging #360 all the previous issues regarding relatively importing step implementations from another project were fixed but when I created step implementations inside a class in different project and tried use those steps inside specs by using the relative import feature, I am getting an error saying
missing 1 required positional argument
despite of having everything correctly present.Gauge-Main-Project/step_impl/step_impl.py
Gauge-Sub-Project/step_impl/step_impl.py
Sample Spec File
To Reproduce:
Steps (or project) to reproduce the behavior:
gauge init python
commandstep_impl.py
files for both the projects like shown aboveGauge-Sub-Project/env/default/python.properties
file like:STEP_IMPL_DIR = step_impl, ../Gauge-Main-Project/step_impl
Logs
Possible Fix:
This issue arises because the
update_step_resgistry_with_class()
method inside theimpl_loader.py
file is unable to fetch all the methods inside that step implementation file insideget_all_methods_in()
method due to thefile_path
being a relative file path.Resolving this relative file path into an absolute file path fixes this issue.
Versions:
Windows 10 (10.0.19045)
3.11.4
1.6.7
Project Structure:
Thanks!😄
The text was updated successfully, but these errors were encountered: