TL;DR
We’ve made a few changes and improvements to our client libraries. This short post aims to provide a quick summary. Look forward to these roundups as we continue to add features and improve our integrations.
Latest Versions
As of writing, these are the latest versions that support the features listed below.
NOTE: the major version has been bumped for all libraries, so your code WILL need to be updated (except the jenkins and CLI) before upgrading to these versions.
packagecloud-ruby: 1.0.2
io.packagecloud.client: 2.0.0
package_cloud (CLI) 0.2.28
packagecloud-plugin: 1.4
Python support across the board
All of our client libraries now support uploading Python packages!
packagecloud-ruby changes
:filename
required
The filename is now required if it cannot be detected (see below).
smarter Package
object
Package.new
now takes an options hash instead of arguments, which cleans up the API a bit and makes it easier to report the user what is wrong with their arguments.
Now, you can pass a file path for :file
or a File
object, (like the previous versions) and it will fill out :filename
for you:
Or, you can pass an IO
object and pass the filename yourself:
fuzzy distro_version_id
lookup
The distro_version_id
has been removed from Package.new
and is now part of the put_package
call. This allows you to push the same Package
instance to multiple distributions without having to recreate the package object, like so:
packagecloud-plugin changes
collaborator repository support
Previously, the username was used for URL generation and jenkins credentials lookup, making it difficult to push to repositories you collaborate on (the workaround was creating another set of credentials, with their username and your token).
Now, there is an extra field for entering the collaborator username, allowing you to use your token on someone else’s repository.
io.packagecloud.client changes
filename required
The filename
is now a required field on Package
collaborator support
Pass the collaborator username into putPackage
and it will be used instead of the loaded credentials one.
Conclusion
We’re constantly improving our client libraries to ensure that you have an excellent user experience using packagecloud.io, from any system. Don’t hesitate to file an issue or open a pull request on our projects. We look forward to hearing your feedback. Pop into our slack or email support@packagecloud.io if you have any questions or comments. Happy packaging!