-
Notifications
You must be signed in to change notification settings - Fork 313
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
Conversation
Codecov Report
@@ 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
|
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'): |
There was a problem hiding this comment.
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,
def _list_files(checker): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, likeroot_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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Sorry for the delay in reviewing. |
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
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