-
Notifications
You must be signed in to change notification settings - Fork 175
Add license file to .pkg installers #1085
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
base: main
Are you sure you want to change the base?
Conversation
What is the recommendation here for testing? Two ideas (I think option 1 is the most simple):
Let me know if you have any other idea/preference. |
I think adding an extra test just for the license file itself is overkill, so option 1 seems simple. However, I also notices that we have no test coverage for all these other files like the content of |
Updated the test in 1dc095c so the error message when running the test actually points to which file is missing, below is the output from running the test locally (except that I forced it to fail for demonstration):
|
1dc095c
to
c82e1c8
Compare
c82e1c8
to
1da6431
Compare
constructor/preconda.py
Outdated
list[os.PathLike]: List of normalized paths of copied locations. | ||
""" | ||
|
||
def check_file_exists(file_path): |
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.
def check_file_exists(file_path): | |
def check_file_exists(file_path: str) -> Path: |
Let's try and add typing where we can. I'm not sure about that function name either - checking isn't really its primary purpose (or that would return a bool
).
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.
Thanks for catching that, will make sure I do that in the future.
I've applied all the changes from the first review, see 436cae7.
For some reason it doesn't work to "Add suggestion to batch", even when I go to "File mode" as the UI suggests.
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.
You may have to switch between the old and new UI to accept suggestions.
examples/extra_files/test_install.sh
Outdated
test -f "$PREFIX/more_data/README.md" || { echo "Missing: $PREFIX/more_data/README.md"; missing=true; } | ||
test -f "$PREFIX/something2.txt" || { echo "Missing: $PREFIX/something2.txt"; missing=true; } |
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.
Using proper if
statements would make the code easier to read.
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.
Fully agree, I changed all of them.
examples/extra_files/test_install.sh
Outdated
|
||
# Ideally we should test the .pkg and .sh installers separately since | ||
# the current behavior for .sh-installers is to include but also rename the license file to LICENSE.txt, | ||
# but for macOS the name of the provided license file remains unchanged. |
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.
# but for macOS the name of the provided license file remains unchanged. | |
# but for .pkg the name of the provided license file remains unchanged. |
@@ -0,0 +1,19 @@ | |||
### Enhancements | |||
|
|||
* The license file is now also included in the installation directory for macOS package (.pkg) installers. |
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.
* The license file is now also included in the installation directory for macOS package (.pkg) installers. | |
* Include the license file in PKG installers. (#1074 via #1085) |
constructor/preconda.py
Outdated
orig_path = Path(origin) | ||
if not orig_path.exists(): | ||
raise FileNotFoundError(f"File {origin} does not exist.") | ||
|
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.
Let's keep diffs small by not adding additional blank lines where they're not necessary.
constructor/shar.py
Outdated
|
||
tarball = join(tmp_dir, "pkgs", "tmp.tar") | ||
t = tarfile.open(tarball, "w") | ||
|
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.
constructor/shar.py
Outdated
|
||
t.add(preconda_tarball, basename(preconda_tarball)) | ||
t.add(postconda_tarball, basename(postconda_tarball)) | ||
|
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.
constructor/shar.py
Outdated
|
||
if "license_file" in info: | ||
t.add(info["license_file"], "LICENSE.txt") | ||
|
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.
626b5e6
to
436cae7
Compare
Description
To resolve #1074
Checklist - did you ...
news
directory (using the template) for the next release's release notes?