Sorin Sbarnea
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
1
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Using pip-compile to tame your test dependencies When building python libraries a developer does only want to declare the compatibility range of the runtime dependencies. This ensures that consumers can make use of future patched dependencies. Still when it comes to **testing** always installing the bleading edge versions published to the pypa.org registry is a recipe for breaking your pipelines. Most of the bugs introduced by new packages published on pypa are usually fixed in few days. As you probably do not want to pay the price of being the early adopter you may like the idea of controlling the test dependecies and upgrading them only when you want. Python developers can learn here from JavaScript world where you get pinned dependencies inside`package-lock.json` while having compatibility ranges defined in `package.json`. Using pip-compile utility, which is part of [pip-tools](https://pypi.org/project/pip-tools/) package one can easily produce lock files, very similar with the result of `pip freeze`. The difference is that these can be produced without creating a virtualenv and that they can be nicely annotated in order to document from where which dependency comes from. pip-compile knows to read dependencies from any combination of `setup.py`, `setup.cfg` or standalone `requirement.in` files, making it very easy to run. By default output is saved inside `requirements.txt`. I would really advise you to read the entire readme of the project as it does explain its use very well. ## What if pip-compile produce different results for some platforms? The result of running pip-compile can produce different results based on operating system or python version being used. If this happens for your project you may have to produce different files for each supported platform. That case is also covered in pip-tools main readme but so far I was able to avoid it. ## Using pip-compile output as constraints If you ever used multiple requirement files with pip you probably discovered that it is very easy to endup with conflicts between them. They secret is to **avoid using multiple requirement files**. If you use pip-compile to produce a single requirements file that covers runtime and all testing requirements, you can use that file as a pip constraint when installing them. So for our use case we want to generate a `constraints.txt`. These files never ship, but they only assure that for we lock/pin test requirements until we decide to update them. When we run pip-compile, we do make use of upstream openstack upper requirements, so our result is compatible with openstack. The difference is that we include more deps, deps which cannot be included in global-requirements for various reasons (popularity, licensing or bureaucracy). ## Using tox to help updating dependencies. Some time ago I seen others using a `tox -e deps` environment which basically called pip-compile and update the pinned dependencies. As arguments passed to pip-compile may be different from project to project and some may even require multiple runs, it is much easier to have a tox environment that does only that. Keep in mind that this environment is not supposed to have a CI/CD pipeline, as it would likely always report changes to the tracked files. ## Outcomes * You can control when you bump dependencies * Installation of test dependencies is much faster, mainly because pip no longer needs to download various versions (pre-resolved) * Running tests on CI or locally are far more likely to produce the same results, mainly because they will use the same set of dependencies, even if you run at different time. # TripleO adoption status This is part of https://projects.engineering.redhat.com/browse/TRIPLEOCI-512 ticket and we currently adopted it to following repos: * Merged * [tripleo-ci-health-queries](https://review.opendev.org/c/openstack/tripleo-ci-health-queries/+/786452) * [ci-config](https://review.rdoproject.org/r/c/rdo-infra/ci-config/+/31400) * Pending * [tripleo-ci](https://review.opendev.org/c/openstack/tripleo-ci/+/797891) review! * [tripleo-repos](https://review.opendev.org/c/openstack/tripleo-repos/+/797125) -- alex asked for explanations, * [tripleo-quickstart](https://review.opendev.org/c/openstack/tripleo-quickstart/+/797901) - wip * Next * tripleo-ansible * tripleo-quickstart * tripleo-quickstart-extras * Next (stage2) * tripleo-ansible * tripleo*

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully