Skip to content

Implemented version tool #466

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

Closed
wants to merge 2 commits into from
Closed

Implemented version tool #466

wants to merge 2 commits into from

Conversation

youknowqyh
Copy link
Contributor

@youknowqyh youknowqyh commented Dec 15, 2021

Implemented a version tool to update version number everywhere.

For example, we want to change version number from 1.0.1-dev to 1.1.1-alpha

image

I use grep command to check whether the script works.

References to other Issues or PRs or Relevant literature

Implemented #444

Brief description of what is fixed or changed

Other comments

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #466 (ce1c52f) into master (c0d2786) will decrease coverage by 0.463%.
The diff coverage is 18.181%.

@@              Coverage Diff              @@
##            master      #466       +/-   ##
=============================================
- Coverage   98.549%   98.086%   -0.464%     
=============================================
  Files           29        30        +1     
  Lines         3792      3814       +22     
=============================================
+ Hits          3737      3741        +4     
- Misses          55        73       +18     
Impacted Files Coverage Δ
version_tool.py 18.181% <18.181%> (ø)

Impacted file tree graph

file_path = ['README.md', 'setup.py']

# Walk through directories to add all corresponding files' paths into file_path
for root, _, files in os.walk('./pydatastructs'):
Copy link
Member

Choose a reason for hiding this comment

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

May be we can re-use the following function to list all the files,

Copy link
Contributor Author

@youknowqyh youknowqyh Jan 8, 2022

Choose a reason for hiding this comment

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

yeah, i see. But the root_path in _list_files doesn't make sense since it will go to '../../cur_file_path'.

So I try to modify the _list_files to pass one more argument, like root_path=None, then we can specify the root_path at will.

Does adding such a modification in _list_files make sense?

Copy link
Member

Choose a reason for hiding this comment

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

So I try to modify the _list_files to pass one more argument, like root_path=None, then we can specify the root_path at will.

Does adding such a modification in _list_files make sense?

Sounds good to me. _list_files is anyway a private function, so changing its API is not a problem.

with open(path, 'r') as file:
data = file.read()
if origin_version in data:
data = data.replace(origin_version, new_version)
Copy link
Member

Choose a reason for hiding this comment

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

👍🏻

@czgdp1807
Copy link
Member

Sorry for the delay in reviewing.

This pull request was closed.
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