

Can we consider --editable a bad practice?
source link: https://developers.redhat.com/articles/2021/05/26/can-we-consider-editable-bad-practice
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Using editable dependencies is becoming more popular, especially if you want to install from a version control system. But --editable
is not without dangers. This article discusses why using editable dependencies should be considered a bad practice, and why it's a particularly bad practice for data scientists using Project Thoth.
The use case for editable dependencies
The use case for editable dependencies
With Python’s pip and with pipenv, you can install dependencies in an editable form. As an example, imagine you wanted to fix a bug. You could install the package from a version control system in an editable way:
pipenv install -e git+https://github.com/requests/requests.git#egg=requests
Now, you can create the changes to fix the bug and test them on your local machine.
Over time, however, we have seen practices that are generally acceptable, but not good for data scientists to follow. One of these practices is to include an application's dependencies in an editable way. If your goal is to change the package itself, like a developer or open source contributor would, --editable
is indeed a good practice. But let's focus on why editable dependencies are bad in the context of data science.
Note: Red Hat's now+Next blog includes posts that discuss technologies that are under active development in upstream open source communities and at Red Hat. We believe in sharing early and often the things we're working on, but we want to note that unless otherwise stated the technologies and how-tos shared here aren't part of supported products, nor promised to be in the future.
Editable dependencies and Project Thoth
Editable dependencies and Project Thoth
Project Thoth is working on a number of software stacks running in Jupyter notebooks, which themselves are run as a container in the context of Open Data Hub. The software stack being run is considered immutable: It’s coming from a container image and has been built up-front, so the container image is read-only.
While the dependencies could have been installed as editable during the container build, the resulting container image will be immutable. Therefore, these dependencies typically should not be edited because they are the known and trusted versions. They are intended to be included as-is in the immutable container images when built by Red Hat OpenShift using Tekton pipelines.
--editable breaks provenance checks
Editable installs are editable versions of a specific package—they can be easily adjusted locally and there is no direct way of controlling what is present in the package source code once it's been adjusted. Also, any package dependency adjustments cannot be tracked. Putting a repeatable and traceable build pipeline in place using editable installs opens the door for untrackable changes.
Using an editable dependency catapults us back into a bygone era, where every deployment is maintained like fine china instead of paper plates: There is no way to tell what software is being executed!
We strongly recommend using so-called provenance checks to verify the origin of the software package going into a deployment.
--editable breaks recommendations
Thoth analyzes dependencies and aggregates information about them, so it has extensive knowledge about which packages are “good” or “bad” with respect to various aspects of the software. Examples include performance indications, Python security issue scores from Bandit, and CVE information.
Packages coming from a local filesystem, or coming randomly from the internet, can introduce malicious or unpredictable behavior. Therefore, we strongly recommend looking at all packages going into a deployment and having a justification for each one.
--editable leads to unpredictable software stacks
As source code introduced by editable installs can have additional adjustments, we simply do not recommend using editable installs for any purpose other than local development or debugging an application.
Conclusion: Work toward predictable software stacks
Conclusion: Work toward predictable software stacks
Always use sources you have vetted and trust, and use properly packaged Python packages released on package indexes conforming to Python Enhancement Proposal (PEP) standards. Use these practices to ensure your applications do not introduce any unpredictable issues.
The CI/CD pipelines in the Operate First initiative are a good place to find resources. With Project Thoth and our services like the Khebhut GitHub marketplace and thamos, we support this mindset and offer a rich knowledge graph as a foundation for your package selection, and ultimately for your decision for what you put into production.
Recommend
-
124
Frame Synopsis Package frame implements graphical, editable text widgets compatible with Plan 9's libframe(3). Unlike libframe, the text is byte-addressed and preserves NUL terminated strings. The related github.com/as/font...
-
33
Using the UIAlertController class it is not only possible to show alerts, but also get text input using Text Fields. In this tutorial a username and password is obtained from the user and displayed in the console. This tu...
-
15
DRK : New DataGrid Example : Editable Fields and StyleProperties Friday, September 13, 2002 Fridays are usually slow, so i decided to put together another quick example of the datagrid component available on the Macrome...
-
10
MacStories Unwind: MindNode Gets an Editable Outlining Mode,...
-
8
Creating an Editable Textarea That Supports Syntax-Highlighted Code Oliver Geer on Apr 16, 2021 Take the pain out of building site search...
-
14
Editable React Table Features Resizing columns Cell data types - number, text, select Renaming column headers Sort on individual columns Adding columns to left or right of a column
-
3
May 25, 2021 — 12:41 CUT MindNode for iPad and iPhone Adds Editable Outline Mode
-
9
Non-editable DNS records Overview You’ll notice that there are numerous non-editable DNS records on your domain’s
-
9
Errors Javascript / bad practice advertisements Is it bad practice to have a single javascript file that gets loaded accross all pages even if...
-
7
Logging in Unit Tests, a Bad Practice 1 Logging is a...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK