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

Feature/setup param #49

Merged
merged 13 commits into from
Aug 7, 2024
Merged

Feature/setup param #49

merged 13 commits into from
Aug 7, 2024

Conversation

AHReccese
Copy link
Member

Reference Issues/PRs

#12
#19

What does this implement/fix? Explain your changes.

Any other comments?

@AHReccese AHReccese added this to the reserver v0.3 milestone Aug 5, 2024
@AHReccese AHReccese self-assigned this Aug 5, 2024
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 36.58537% with 26 lines in your changes missing coverage. Please review.

Project coverage is 69.19%. Comparing base (d71d7d3) to head (ae4c26c).
Report is 74 commits behind head on dev.

Files Patch % Lines
reserver/reserver_obj.py 21.74% 15 Missing and 3 partials ⚠️
reserver/util.py 38.47% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              dev      #49       +/-   ##
===========================================
- Coverage   82.76%   69.19%   -13.56%     
===========================================
  Files           5        6        +1     
  Lines          87      185       +98     
  Branches       10       38       +28     
===========================================
+ Hits           72      128       +56     
- Misses          6       42       +36     
- Partials        9       15        +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AHReccese AHReccese marked this pull request as ready for review August 5, 2024 19:53
@AHReccese AHReccese requested a review from sadrasabouri August 5, 2024 20:00
Copy link
Member

@sadrasabouri sadrasabouri left a comment

Choose a reason for hiding this comment

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

I left some comments. Thank you for your efforts

# [get_random_name(), get_random_name() + get_random_name()],
# ["config.json", "config2.json"]
# ) == 2
assert True == True
Copy link
Member

Choose a reason for hiding this comment

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

Add an extra new line at the end of this file.

Comment on lines +1 to +9
{
"description": "[config] This name has been reserved using Reserver",
"author": "[config] Development Team",
"author_email": "[email protected]",
"url": "https://configurl.com",
"download_url": "https://configdownload_url.com",
"source": "https://configgithub.com/source",
"license": "[config] MIT"
}
Copy link
Member

Choose a reason for hiding this comment

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

Also, add an example of this to README.md.

Copy link
Member Author

Choose a reason for hiding this comment

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

after this PR, I will handle CLI in which we can handle custom batch uploads
then I will update README.md

reserver/util.py Outdated
config_file = open(file_name)
return json.load(config_file)
else:
raise ReserverBaseError(PARAM_FILE_DOES_NOT_EXIST_ERROR)
Copy link
Member

Choose a reason for hiding this comment

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

Add extra new line to the end of this file.

reserver/util.py Outdated
Comment on lines 49 to 50
if ".json" not in file_name:
file_name = file_name + ".json"
Copy link
Member

Choose a reason for hiding this comment

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

That's not a good check. They may have a json file without .json extension. This is a bit over-engineering.

INVALID_PACKAGE_PARAMETER_VALUE_ERROR = "Invalid value for {parameter} that should be a valid {regex}"
INVALID_CONFIG_FILE_NAME_ERROR = "Given file name for user-defined setup.py params is not a string."
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure about setup.py?

Copy link
Member Author

Choose a reason for hiding this comment

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

I update the error message, changing setup.py with package.

PARAM_FILE_DOES_NOT_EXIST_ERROR = "Given file doesn't exist."
INVALID_INPUT_USER_PARAM = "Invalid input for user params."
UNEQUAL_PARAM_NAME_LENGTH_ERROR = "You should pass either one single file path to be used for setup.py parameters \
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about setup.py again.
Also, I prefer this:

`user_params_path` should be either a path or a list of paths to the config file(s).

Copy link
Member Author

Choose a reason for hiding this comment

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

I update the error message, changing setup.py with package.

INVALID_INPUT_USER_PARAM = "Invalid input for user params."
UNEQUAL_PARAM_NAME_LENGTH_ERROR = "You should pass either one single file path to be used for setup.py parameters \
or per each package name, there should be a specific dedicated file path."
Copy link
Member

Choose a reason for hiding this comment

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

Also, add a new line at the end of this file.

@AHReccese AHReccese requested a review from sadrasabouri August 6, 2024 13:50
@AHReccese AHReccese force-pushed the feature/setup_param branch from b716523 to 4496359 Compare August 6, 2024 17:13
@sadrasabouri sadrasabouri merged commit 113bd91 into dev Aug 7, 2024
84 checks passed
@sadrasabouri sadrasabouri deleted the feature/setup_param branch August 7, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants