Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd tempdir() to avoid unwanted package file writing #239
Conversation
|
The AppVeyor errors are not related to my commit; the VM cannot initialise due to a bad gateway (error 502). Probably is helps to re-run the check. |
|
Thanks, completely agree with your points here. Also, I completely agree with the case for making
|
+ updating the roxygen docs
+ linking this PR
|
Done. Regarding the file size, my suggestion would be something like this: sum(file.size(
list.files(
".",
recursive = TRUE,
full.names = TRUE,
all.files = FALSE
)
)) / 1000It takes on my computer (five years old) 1.5 ms to compute and it is more realistic than the package size after the package was built, which depends too much on compiler settings. Side effect, if I do not overlook something, it would also remove the dependency to 'pkgbuild'. |
|
@RLumSK Thanks, these changes look great. If you'd like, I'd be happy to include the revised file-size calculation and drop the |
+ Amend guess_fileSize() in guess_other_metadata.R as proposed #239 + Update tests + Drop dependency to 'pkgbuild' + Add NEWS in NEWS.md
+ Amend guess_fileSize() in guess_other_metadata.R as proposed #239 + Update tests + Drop dependency to 'pkgbuild' + Update documentation in 'write_codemeta()' + Upddate corresponding Rd-files + Add NEWS in NEWS.md
…eanup_after_pkg_build
|
Done. Besides, I kept the newly set default values for |
|
Very nice, thanks for this! |
63bb55f
into
ropensci:master
* Add tempdir() to avoid to writing guess_other_metadata() into the parent directory. * + swap the default + updating the roxygen docs * + Add myself as a ctb in DESCRIPTION * + mention of changes in NEWS.md + linking this PR * Address #240 and avoid pre-commit hook without user consent * Correct link in NEWS.md #240 * Modify the way the file size is calculated. + Amend guess_fileSize() in guess_other_metadata.R as proposed #239 + Update tests + Drop dependency to 'pkgbuild' + Add NEWS in NEWS.md * Modify the way the file size is calculated. + Amend guess_fileSize() in guess_other_metadata.R as proposed #239 + Update tests + Drop dependency to 'pkgbuild' + Update documentation in 'write_codemeta()' + Upddate corresponding Rd-files + Add NEWS in NEWS.md * Address #238 + Add NEWS * Update tests and add CITATION_ex2 #241
Background
Calling
create_codemeta(use_filesize = TRUE)(the default) usespkgbuild::build()to build the package and estimates its file size.Unfortunately, it does not clean-up after and leaves unwanted files behind in the user's home filespace (here in the parent directory). While doing so, the package violates the CRAN policy:
Solution
pkgbuild::build()provides the argumentdest_path. This argument can be set totempdir()to avoid the trouble, which is the solution I propose with my PR.Further remarks
Besides it might be reasonable to make
create_codemeta(use_filesize = FALSE)the default (not part of my PR). If a package contains a lot of code to compile it takes quite some time, and the reason for the waiting time is not immanently obvious.