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

use pathlib #626

Merged
merged 2 commits into from
Mar 3, 2020
Merged

use pathlib #626

merged 2 commits into from
Mar 3, 2020

Conversation

eine
Copy link
Collaborator

@eine eine commented Feb 14, 2020

In this PR, all usages of abspath, basename, dirname, exists, isdir, join, isfile, splittext... from os.path are replaced with Path from pathlib. A few resources from os.path are kept (getmtime, relpath, splitdrive, commonprefix).

The modifications in this PR should NOT introduce any breaking change, as I tried to keep internal data types (strings).

In the second commit, some type annotations are added to vunit/ui/__init__.py.

Actually, this PR is a cleaning phase before properly using Path internally. Future work should consist on evaluating when explicit conversions to str can be avoided. I believe this should be done together with adding type annotations, as it allows to better catch inconsistencies.

@eine eine force-pushed the use-pathlib branch 3 times, most recently from 04cdf1d to d05ff3b Compare February 15, 2020 04:59
@eine eine force-pushed the use-pathlib branch 3 times, most recently from 0115d6b to 3e0d581 Compare March 2, 2020 09:33
eine referenced this pull request in eine/vunit Mar 2, 2020
@eine eine merged commit af7b89d into VUnit:master Mar 3, 2020
@eine eine deleted the use-pathlib branch March 3, 2020 02:35
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.

1 participant