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

Changed tokens to be handled externally, CI fixes, and fixed package structure. #6

Closed
wants to merge 1 commit into from

Conversation

rawe0
Copy link
Collaborator

@rawe0 rawe0 commented Aug 29, 2024

The tokens are now handled externally to allow parallelism (makes the package stateless) which allows to user to reuse the connection in multiple threads. Methods for handling token operations (check_token, get_token) are still available and public to the user.

The CI has also been updated to build the package and install it using pip and the package structure has been corrected because of this. The unit tests now use the package that is installed instead of importing directly from the .py files, changes in the source code has also been made to reflect this change. This change is important because it tests that the package works as it should as a package.

@rawe0 rawe0 assigned diocas and glpatcern and unassigned diocas and glpatcern Aug 29, 2024
@rawe0 rawe0 requested review from diocas and glpatcern August 29, 2024 09:12
examples/auth_example.py Dismissed Show resolved Hide resolved
if res is not None:
print(res)

# touchfile
touch_resource = Resource.from_file_ref_and_endpoint("/eos/user/r/rwelande/touch_file.txt")
text_resource = Resource.from_file_ref_and_endpoint("/eos/user/r/rwelande/text_file.txt")
res = client.file.touch_file(touch_resource)
res = client.file.touch_file(text_resource)
res = client.file.touch_file(client.auth.get_token(), touch_resource)

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'res' is unnecessary as it is
redefined
before this value is used.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code is an example and can be ignored.


if res is not None:
print(res)

res = client.file.touch_file(touch_resource)
res = client.file.touch_file(client.auth.get_token(), touch_resource)

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'res' is unnecessary as it is
redefined
before this value is used.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code is an example and can be ignored.

@rawe0 rawe0 closed this Aug 29, 2024
@rawe0 rawe0 deleted the dev branch August 29, 2024 09:42
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.

3 participants