pypa-hatch/1.5/plugins/builder/reference/index.html

546 lines
143 KiB
HTML

<!DOCTYPE html><html class=no-js lang=en> <head><meta charset=utf-8><meta content="width=device-width,initial-scale=1" name=viewport><meta content="Modern, extensible Python project management" name=description><meta content="Ofek Lev" name=author><link href=https://hatch.pypa.io/latest/1.5/plugins/builder/reference/ rel=canonical><link href=../../../assets/images/logo.svg rel=icon><meta content="mkdocs-1.4.0, mkdocs-material-8.5.6+insiders-4.25.2" name=generator><title>Reference - Hatch</title><link href=../../../assets/stylesheets/main.fa1d38d9.min.css rel=stylesheet><link href=../../../assets/stylesheets/palette.cbb835fc.min.css rel=stylesheet><link crossorigin href=https://fonts.gstatic.com rel=preconnect><link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback" rel=stylesheet><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><link href=../../../assets/_mkdocstrings.css rel=stylesheet><link href=../../../assets/css/custom.css rel=stylesheet><link href=https://cdn.jsdelivr.net/gh/tonsky/FiraCode@5.2/distr/fira_code.css rel=stylesheet><script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script><link href=../../../assets/stylesheets/glightbox.min.css rel=stylesheet><style>
html.glightbox-open { overflow: initial; height: 100%; }
.gdesc-inner { font-size: 0.75rem; }
.gslide-title { margin-top: 0px; user-select: text; }
.gslide-desc { color: #666; user-select: text; }
.gslide-image img { background: white; }
.gscrollbar-fixer { padding-right: 15px; }
</style><script src=../../../assets/javascripts/glightbox.min.js></script></head> <body data-md-color-accent=indigo data-md-color-primary=indigo data-md-color-scheme=slate dir=ltr> <input autocomplete=off class=md-toggle data-md-toggle=drawer id=__drawer type=checkbox> <input autocomplete=off class=md-toggle data-md-toggle=search id=__search type=checkbox> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a class=md-skip href=#builder-plugins> Skip to content </a> </div> <div data-md-component=announce> </div> <div data-md-component=outdated hidden> </div> <header class="md-header md-header--lifted" data-md-component=header> <nav aria-label=Header class="md-header__inner md-grid"> <a aria-label=Hatch class="md-header__button md-logo" data-md-component=logo href=../../.. title=Hatch> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M19.5 14.5A7.5 7.5 0 0 1 12 22a7.5 7.5 0 0 1-7.5-7.5C4.5 10.36 7.86 2 12 2c4.14 0 7.5 8.36 7.5 12.5Z"></path></svg> </a> <label class="md-header__button md-icon" for=__drawer> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"></path></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> Hatch </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Reference </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input aria-label="Switch to light mode" class=md-option data-md-color-accent=indigo data-md-color-media="(prefers-color-scheme: dark)" data-md-color-primary=indigo data-md-color-scheme=slate id=__palette_0 name=__palette type=radio> <label class="md-header__button md-icon" for=__palette_1 hidden title="Switch to light mode"> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3 3.19.09m3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95 2.06.05m-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31Z"></path></svg> </label> <input aria-label="Switch to dark mode" class=md-option data-md-color-accent=indigo data-md-color-media="(prefers-color-scheme: light)" data-md-color-primary=indigo data-md-color-scheme=default id=__palette_1 name=__palette type=radio> <label class="md-header__button md-icon" for=__palette_0 hidden title="Switch to dark mode"> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5c-.84 0-1.65.15-2.39.42L12 2M3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29L3.34 7m.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14L3.36 17M20.65 7l-1.77 3.79a7.023 7.023 0 0 0-2.38-4.15l4.15.36m-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29L20.64 17M12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44L12 22Z"></path></svg> </label> </form> <script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <label class="md-header__button md-icon" for=__search> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"></path></svg> </label> <div class=md-search data-md-component=search role=dialog> <label class=md-search__overlay for=__search></label> <div class=md-search__inner role=search> <form class=md-search__form name=search> <input aria-label=Search autocapitalize=off autocomplete=off autocorrect=off class=md-search__input data-md-component=search-query name=query placeholder=Search required spellcheck=false type=text> <label class="md-search__icon md-icon" for=__search> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"></path></svg> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"></path></svg> </label> <nav aria-label=Search class=md-search__options> <button aria-label=Clear class="md-search__icon md-icon" tabindex=-1 title=Clear type=reset> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"></path></svg> </button> </nav> </form> <div class=md-search__output> <div class=md-search__scrollwrap data-md-scrollfix> <div class=md-search-result data-md-component=search-result> <div class=md-search-result__meta> Initializing search </div> <ol class=md-search-result__list></ol> </div> </div> </div> </div> </div> <div class=md-header__source> <a class=md-source data-md-component=source href=https://github.com/pypa/hatch title="Go to repository"> <div class="md-source__icon md-icon"> <svg viewbox="0 0 480 512" xmlns=http://www.w3.org/2000/svg><!-- Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"></path></svg> </div> <div class=md-source__repository> pypa/hatch </div> </a> </div> </nav> <nav aria-label=Tabs class=md-tabs data-md-component=tabs> <div class="md-tabs__inner md-grid"> <ul class=md-tabs__list> <li class=md-tabs__item> <a class=md-tabs__link href=../../..> Home </a> </li> <li class=md-tabs__item> <a href=../../../config/metadata/ class=md-tabs__link> Configuration </a> </li> <li class=md-tabs__item> <a href=../../../cli/about/ class=md-tabs__link> CLI </a> </li> <li class=md-tabs__item> <a href=../../about/ class="md-tabs__link md-tabs__link--active"> Plugins </a> </li> <li class=md-tabs__item> <a href=../../../how-to/environment/package-indices/ class=md-tabs__link> How-to </a> </li> <li class=md-tabs__item> <a href=../../../meta/faq/ class=md-tabs__link> Meta </a> </li> <li class=md-tabs__item> <a href=../../../blog/ class=md-tabs__link> Blog </a> </li> </ul> </div> </nav> </header> <div class=md-container data-md-component=container> <main class=md-main data-md-component=main> <div class="md-main__inner md-grid"> <div class="md-sidebar md-sidebar--primary" data-md-component=sidebar data-md-type=navigation> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav aria-label=Navigation class="md-nav md-nav--primary md-nav--lifted" data-md-level=0> <label class=md-nav__title for=__drawer> <a aria-label=Hatch class="md-nav__button md-logo" data-md-component=logo href=../../.. title=Hatch> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M19.5 14.5A7.5 7.5 0 0 1 12 22a7.5 7.5 0 0 1-7.5-7.5C4.5 10.36 7.86 2 12 2c4.14 0 7.5 8.36 7.5 12.5Z"></path></svg> </a> Hatch </label> <div class=md-nav__source> <a class=md-source data-md-component=source href=https://github.com/pypa/hatch title="Go to repository"> <div class="md-source__icon md-icon"> <svg viewbox="0 0 480 512" xmlns=http://www.w3.org/2000/svg><!-- Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"></path></svg> </div> <div class=md-source__repository> pypa/hatch </div> </a> </div> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_1 id=__nav_1 type=checkbox> <label class=md-nav__link for=__nav_1> <span class=md-ellipsis> Home </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Home class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_1> <span class="md-nav__icon md-icon"></span> Home </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a class=md-nav__link href=../../..> <span class=md-ellipsis> About </span> </a> </li> <li class=md-nav__item> <a href=../../../install/ class=md-nav__link> <span class=md-ellipsis> Installation </span> </a> </li> <li class=md-nav__item> <a href=../../../intro/ class=md-nav__link> <span class=md-ellipsis> Introduction </span> </a> </li> <li class=md-nav__item> <a href=../../../environment/ class=md-nav__link> <span class=md-ellipsis> Environments </span> </a> </li> <li class=md-nav__item> <a href=../../../version/ class=md-nav__link> <span class=md-ellipsis> Versioning </span> </a> </li> <li class=md-nav__item> <a href=../../../build/ class=md-nav__link> <span class=md-ellipsis> Builds </span> </a> </li> <li class=md-nav__item> <a href=../../../publish/ class=md-nav__link> <span class=md-ellipsis> Publishing </span> </a> </li> <li class=md-nav__item> <a href=../../../next-steps/ class=md-nav__link> <span class=md-ellipsis> Next steps </span> </a> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_1_9 id=__nav_1_9 type=checkbox> <label class=md-nav__link for=__nav_1_9> <span class=md-ellipsis> Status </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Status class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_1_9> <span class="md-nav__icon md-icon"></span> Status </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../history/ class=md-nav__link> <span class=md-ellipsis> History </span> </a> </li> <li class=md-nav__item> <a href=../../../users/ class=md-nav__link> <span class=md-ellipsis> Users </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_2 id=__nav_2 type=checkbox> <label class=md-nav__link for=__nav_2> <span class=md-ellipsis> Configuration </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Configuration class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_2> <span class="md-nav__icon md-icon"></span> Configuration </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../config/metadata/ class=md-nav__link> <span class=md-ellipsis> Metadata </span> </a> </li> <li class=md-nav__item> <a href=../../../config/dependency/ class=md-nav__link> <span class=md-ellipsis> Dependencies </span> </a> </li> <li class=md-nav__item> <a href=../../../config/build/ class=md-nav__link> <span class=md-ellipsis> Build </span> </a> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_2_4 id=__nav_2_4 type=checkbox> <label class=md-nav__link for=__nav_2_4> <span class=md-ellipsis> Environments </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Environments class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_2_4> <span class="md-nav__icon md-icon"></span> Environments </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../config/environment/overview/ class=md-nav__link> <span class=md-ellipsis> Overview </span> </a> </li> <li class=md-nav__item> <a href=../../../config/environment/advanced/ class=md-nav__link> <span class=md-ellipsis> Advanced </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../../../config/context/ class=md-nav__link> <span class=md-ellipsis> Context formatting </span> </a> </li> <li class=md-nav__item> <a href=../../../config/project-templates/ class=md-nav__link> <span class=md-ellipsis> Project templates </span> </a> </li> <li class=md-nav__item> <a href=../../../config/hatch/ class=md-nav__link> <span class=md-ellipsis> Hatch </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_3 id=__nav_3 type=checkbox> <label class=md-nav__link for=__nav_3> <span class=md-ellipsis> CLI </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=CLI class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_3> <span class="md-nav__icon md-icon"></span> CLI </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../cli/about/ class=md-nav__link> <span class=md-ellipsis> About </span> </a> </li> <li class=md-nav__item> <a href=../../../cli/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--active md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle" data-md-toggle=__nav_4 id=__nav_4 type=checkbox> <label class=md-nav__link for=__nav_4> <span class=md-ellipsis> Plugins </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Plugins class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_4> <span class="md-nav__icon md-icon"></span> Plugins </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../about/ class=md-nav__link> <span class=md-ellipsis> About </span> </a> </li> <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle" data-md-toggle=__nav_4_2 id=__nav_4_2 type=checkbox> <label class=md-nav__link for=__nav_4_2> <span class=md-ellipsis> Builder </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Builder class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_2> <span class="md-nav__icon md-icon"></span> Builder </label> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--active"> <input class="md-nav__toggle md-toggle" data-md-toggle=toc id=__toc type=checkbox> <label class="md-nav__link md-nav__link--active" for=__toc> <span class=md-ellipsis> Reference </span> <span class="md-nav__icon md-icon"></span> </label> <a href=./ class="md-nav__link md-nav__link--active"> <span class=md-ellipsis> Reference </span> </a> <nav aria-label="Table of contents" class="md-nav md-nav--secondary"> <label class=md-nav__title for=__toc> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class=md-nav__list data-md-component=toc data-md-scrollfix> <li class=md-nav__item> <a class=md-nav__link href=#known-third-party> <span class=md-ellipsis> Known third-party </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface> <span class=md-ellipsis> BuilderInterface </span> </a> <nav aria-label=BuilderInterface class=md-nav> <ul class=md-nav__list> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.PLUGIN_NAME> <span class=md-ellipsis> PLUGIN_NAME </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.app> <span class=md-ellipsis> app() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.root> <span class=md-ellipsis> root() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.build_config> <span class=md-ellipsis> build_config() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.target_config> <span class=md-ellipsis> target_config() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.config> <span class=md-ellipsis> config() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_config_class> <span class=md-ellipsis> get_config_class() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_version_api> <span class=md-ellipsis> get_version_api() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_default_versions> <span class=md-ellipsis> get_default_versions() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.clean> <span class=md-ellipsis> clean() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.recurse_included_files> <span class=md-ellipsis> recurse_included_files() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_default_build_data> <span class=md-ellipsis> get_default_build_data() </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../wheel/ class=md-nav__link> <span class=md-ellipsis> Wheel </span> </a> </li> <li class=md-nav__item> <a href=../sdist/ class=md-nav__link> <span class=md-ellipsis> Source distribution </span> </a> </li> <li class=md-nav__item> <a href=../custom/ class=md-nav__link> <span class=md-ellipsis> Custom </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_3 id=__nav_4_3 type=checkbox> <label class=md-nav__link for=__nav_4_3> <span class=md-ellipsis> Build hook </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label="Build hook" class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_3> <span class="md-nav__icon md-icon"></span> Build hook </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../build-hook/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../build-hook/version/ class=md-nav__link> <span class=md-ellipsis> Version </span> </a> </li> <li class=md-nav__item> <a href=../../build-hook/custom/ class=md-nav__link> <span class=md-ellipsis> Custom </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_4 id=__nav_4_4 type=checkbox> <label class=md-nav__link for=__nav_4_4> <span class=md-ellipsis> Metadata hook </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label="Metadata hook" class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_4> <span class="md-nav__icon md-icon"></span> Metadata hook </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../metadata-hook/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../metadata-hook/custom/ class=md-nav__link> <span class=md-ellipsis> Custom </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_5 id=__nav_4_5 type=checkbox> <label class=md-nav__link for=__nav_4_5> <span class=md-ellipsis> Environment </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Environment class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_5> <span class="md-nav__icon md-icon"></span> Environment </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../environment/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../environment/virtual/ class=md-nav__link> <span class=md-ellipsis> Virtual </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_6 id=__nav_4_6 type=checkbox> <label class=md-nav__link for=__nav_4_6> <span class=md-ellipsis> Environment collector </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label="Environment collector" class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_6> <span class="md-nav__icon md-icon"></span> Environment collector </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../environment-collector/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../environment-collector/default/ class=md-nav__link> <span class=md-ellipsis> Default </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_7 id=__nav_4_7 type=checkbox> <label class=md-nav__link for=__nav_4_7> <span class=md-ellipsis> Publisher </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Publisher class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_7> <span class="md-nav__icon md-icon"></span> Publisher </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../publisher/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../publisher/package-index/ class=md-nav__link> <span class=md-ellipsis> Index </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_8 id=__nav_4_8 type=checkbox> <label class=md-nav__link for=__nav_4_8> <span class=md-ellipsis> Version source </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label="Version source" class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_8> <span class="md-nav__icon md-icon"></span> Version source </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../version-source/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../version-source/regex/ class=md-nav__link> <span class=md-ellipsis> Regex </span> </a> </li> <li class=md-nav__item> <a href=../../version-source/code/ class=md-nav__link> <span class=md-ellipsis> Code </span> </a> </li> <li class=md-nav__item> <a href=../../version-source/env/ class=md-nav__link> <span class=md-ellipsis> Environment </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_4_9 id=__nav_4_9 type=checkbox> <label class=md-nav__link for=__nav_4_9> <span class=md-ellipsis> Version scheme </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label="Version scheme" class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_4_9> <span class="md-nav__icon md-icon"></span> Version scheme </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../version-scheme/reference/ class=md-nav__link> <span class=md-ellipsis> Reference </span> </a> </li> <li class=md-nav__item> <a href=../../version-scheme/standard/ class=md-nav__link> <span class=md-ellipsis> Standard </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../../utilities/ class=md-nav__link> <span class=md-ellipsis> Utilities </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_5 id=__nav_5 type=checkbox> <label class=md-nav__link for=__nav_5> <span class=md-ellipsis> How-to </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=How-to class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_5> <span class="md-nav__icon md-icon"></span> How-to </label> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_5_1 id=__nav_5_1 type=checkbox> <label class=md-nav__link for=__nav_5_1> <span class=md-ellipsis> Environments </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Environments class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_5_1> <span class="md-nav__icon md-icon"></span> Environments </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../how-to/environment/package-indices/ class=md-nav__link> <span class=md-ellipsis> Package indices </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--section md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_5_2 id=__nav_5_2 type=checkbox> <label class=md-nav__link for=__nav_5_2> <span class=md-ellipsis> Plugins </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Plugins class=md-nav data-md-level=2> <label class=md-nav__title for=__nav_5_2> <span class="md-nav__icon md-icon"></span> Plugins </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../how-to/plugins/testing-builds/ class=md-nav__link> <span class=md-ellipsis> Testing builds </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_6 id=__nav_6 type=checkbox> <label class=md-nav__link for=__nav_6> <span class=md-ellipsis> Meta </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Meta class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_6> <span class="md-nav__icon md-icon"></span> Meta </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../meta/faq/ class=md-nav__link> <span class=md-ellipsis> FAQ </span> </a> </li> <li class=md-nav__item> <a href=../../../meta/authors/ class=md-nav__link> <span class=md-ellipsis> Authors </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input checked class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle=__nav_7 id=__nav_7 type=checkbox> <label class=md-nav__link for=__nav_7> <span class=md-ellipsis> Blog </span> <span class="md-nav__icon md-icon"></span> </label> <nav aria-label=Blog class=md-nav data-md-level=1> <label class=md-nav__title for=__nav_7> <span class="md-nav__icon md-icon"></span> Blog </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../../../blog/ class=md-nav__link> <span class=md-ellipsis> Blog </span> </a> </li> </ul> </nav> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component=sidebar data-md-type=toc> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav aria-label="Table of contents" class="md-nav md-nav--secondary"> <label class=md-nav__title for=__toc> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class=md-nav__list data-md-component=toc data-md-scrollfix> <li class=md-nav__item> <a class=md-nav__link href=#known-third-party> <span class=md-ellipsis> Known third-party </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface> <span class=md-ellipsis> BuilderInterface </span> </a> <nav aria-label=BuilderInterface class=md-nav> <ul class=md-nav__list> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.PLUGIN_NAME> <span class=md-ellipsis> PLUGIN_NAME </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.app> <span class=md-ellipsis> app() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.root> <span class=md-ellipsis> root() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.build_config> <span class=md-ellipsis> build_config() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.target_config> <span class=md-ellipsis> target_config() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.config> <span class=md-ellipsis> config() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_config_class> <span class=md-ellipsis> get_config_class() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_version_api> <span class=md-ellipsis> get_version_api() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_default_versions> <span class=md-ellipsis> get_default_versions() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.clean> <span class=md-ellipsis> clean() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.recurse_included_files> <span class=md-ellipsis> recurse_included_files() </span> </a> </li> <li class=md-nav__item> <a class=md-nav__link href=#hatchling.builders.plugin.interface.BuilderInterface.get_default_build_data> <span class=md-ellipsis> get_default_build_data() </span> </a> </li> </ul> </nav> </li> </ul> </nav> </div> </div> </div> <div class=md-content data-md-component=content> <article class="md-content__inner md-typeset"> <a class="md-content__button md-icon" href=https://github.com/pypa/hatch/blob/master/docs/plugins/builder/reference.md title="Edit this page"> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25Z"></path></svg> </a> <h1 id=builder-plugins>Builder plugins<a class=headerlink href=#builder-plugins title="Permanent link"></a></h1> <hr> <p>See the documentation for <a href=../../../config/build/ >build configuration</a>.</p> <h2 id=known-third-party>Known third-party<a class=headerlink href=#known-third-party title="Permanent link"></a></h2> <ul> <li><a href=https://github.com/aka-raccoon/hatch-aws>hatch-aws</a> - used for building AWS Lambda functions with SAM</li> <li><a href=https://github.com/dairiki/hatch-zipped-directory>hatch-zipped-directory</a> - used for building ZIP archives for installation into various foreign package installation systems</li> </ul> <div class="doc doc-object doc-class"> <h2 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface> <code>BuilderInterface</code> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface title="Permanent link"></a></h2> <div class="doc doc-contents first"> <p>Example usage:</p> <div class="tabbed-set tabbed-alternate" data-tabs=1:2><input checked=checked id=hatchling.builders.plugin.interface.BuilderInterface--__tabbed_1_1 name=hatchling.builders.plugin.interface.BuilderInterface--__tabbed_1 type=radio><input id=hatchling.builders.plugin.interface.BuilderInterface--__tabbed_1_2 name=hatchling.builders.plugin.interface.BuilderInterface--__tabbed_1 type=radio><div class=tabbed-labels><label for=hatchling.builders.plugin.interface.BuilderInterface--__tabbed_1_1><span class=twemoji><svg viewbox="0 0 16 16" xmlns=http://www.w3.org/2000/svg><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 0 0-.011-.013l-2.914-2.914a.272.272 0 0 0-.013-.011zM5.72 6.72a.75.75 0 0 0 0 1.06l1.47 1.47-1.47 1.47a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0zM3.28 7.78a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 0 0 1.06-1.06L1.81 9.25l1.47-1.47z" fill-rule=evenodd></path></svg></span> plugin.py</label><label for=hatchling.builders.plugin.interface.BuilderInterface--__tabbed_1_2><span class=twemoji><svg viewbox="0 0 16 16" xmlns=http://www.w3.org/2000/svg><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 0 0-.011-.013l-2.914-2.914a.272.272 0 0 0-.013-.011zM5.72 6.72a.75.75 0 0 0 0 1.06l1.47 1.47-1.47 1.47a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0zM3.28 7.78a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 0 0 1.06-1.06L1.81 9.25l1.47-1.47z" fill-rule=evenodd></path></svg></span> hooks.py</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=kn>from</span> <span class=nn>hatchling.builders.plugin.interface</span> <span class=kn>import</span> <span class=n>BuilderInterface</span>
<span class=k>class</span> <span class=nc>SpecialBuilder</span><span class=p>(</span><span class=n>BuilderInterface</span><span class=p>):</span>
<span class=n>PLUGIN_NAME</span> <span class=o>=</span> <span class=s1>'special'</span>
<span class=o>...</span>
</code></pre></div> </div> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=kn>from</span> <span class=nn>hatchling.plugin</span> <span class=kn>import</span> <span class=n>hookimpl</span>
<span class=kn>from</span> <span class=nn>.plugin</span> <span class=kn>import</span> <span class=n>SpecialBuilder</span>
<span class=nd>@hookimpl</span>
<span class=k>def</span> <span class=nf>hatch_register_builder</span><span class=p>():</span>
<span class=k>return</span> <span class=n>SpecialBuilder</span>
</code></pre></div> </div> </div> </div> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos=" 22 "></span><span class=k>class</span> <span class=nc>BuilderInterface</span><span class=p>(</span><span class=n>ABC</span><span class=p>):</span>
<span class=linenos data-linenos=" 23 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos=" 24 "></span><span class=sd> Example usage:</span>
<span class=linenos data-linenos=" 25 "></span>
<span class=linenos data-linenos=" 26 "></span><span class=sd> === ":octicons-file-code-16: plugin.py"</span>
<span class=linenos data-linenos=" 27 "></span>
<span class=linenos data-linenos=" 28 "></span><span class=sd> ```python</span>
<span class=linenos data-linenos=" 29 "></span><span class=sd> from hatchling.builders.plugin.interface import BuilderInterface</span>
<span class=linenos data-linenos=" 30 "></span>
<span class=linenos data-linenos=" 31 "></span>
<span class=linenos data-linenos=" 32 "></span><span class=sd> class SpecialBuilder(BuilderInterface):</span>
<span class=linenos data-linenos=" 33 "></span><span class=sd> PLUGIN_NAME = 'special'</span>
<span class=linenos data-linenos=" 34 "></span><span class=sd> ...</span>
<span class=linenos data-linenos=" 35 "></span><span class=sd> ```</span>
<span class=linenos data-linenos=" 36 "></span>
<span class=linenos data-linenos=" 37 "></span><span class=sd> === ":octicons-file-code-16: hooks.py"</span>
<span class=linenos data-linenos=" 38 "></span>
<span class=linenos data-linenos=" 39 "></span><span class=sd> ```python</span>
<span class=linenos data-linenos=" 40 "></span><span class=sd> from hatchling.plugin import hookimpl</span>
<span class=linenos data-linenos=" 41 "></span>
<span class=linenos data-linenos=" 42 "></span><span class=sd> from .plugin import SpecialBuilder</span>
<span class=linenos data-linenos=" 43 "></span>
<span class=linenos data-linenos=" 44 "></span>
<span class=linenos data-linenos=" 45 "></span><span class=sd> @hookimpl</span>
<span class=linenos data-linenos=" 46 "></span><span class=sd> def hatch_register_builder():</span>
<span class=linenos data-linenos=" 47 "></span><span class=sd> return SpecialBuilder</span>
<span class=linenos data-linenos=" 48 "></span><span class=sd> ```</span>
<span class=linenos data-linenos=" 49 "></span><span class=sd> """</span>
<span class=linenos data-linenos=" 50 "></span>
<span class=linenos data-linenos=" 51 "></span> <span class=n>PLUGIN_NAME</span> <span class=o>=</span> <span class=s1>''</span>
<span class=linenos data-linenos=" 52 "></span> <span class=sd>"""The name used for selection."""</span>
<span class=linenos data-linenos=" 53 "></span>
<span class=linenos data-linenos=" 54 "></span> <span class=k>def</span> <span class=fm>__init__</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>root</span><span class=p>,</span> <span class=n>plugin_manager</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span> <span class=n>config</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span> <span class=n>metadata</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span> <span class=n>app</span><span class=o>=</span><span class=kc>None</span><span class=p>):</span>
<span class=linenos data-linenos=" 55 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__root</span> <span class=o>=</span> <span class=n>root</span>
<span class=linenos data-linenos=" 56 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__plugin_manager</span> <span class=o>=</span> <span class=n>plugin_manager</span>
<span class=linenos data-linenos=" 57 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__raw_config</span> <span class=o>=</span> <span class=n>config</span>
<span class=linenos data-linenos=" 58 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__metadata</span> <span class=o>=</span> <span class=n>metadata</span>
<span class=linenos data-linenos=" 59 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span> <span class=o>=</span> <span class=n>app</span>
<span class=linenos data-linenos=" 60 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 61 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_config</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 62 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__hatch_config</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 63 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 64 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_targets</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 65 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 66 "></span>
<span class=linenos data-linenos=" 67 "></span> <span class=c1># Metadata</span>
<span class=linenos data-linenos=" 68 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_id</span> <span class=o>=</span> <span class=kc>None</span>
<span class=linenos data-linenos=" 69 "></span>
<span class=linenos data-linenos=" 70 "></span> <span class=k>def</span> <span class=nf>build</span><span class=p>(</span>
<span class=linenos data-linenos=" 71 "></span> <span class=bp>self</span><span class=p>,</span>
<span class=linenos data-linenos=" 72 "></span> <span class=n>directory</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span>
<span class=linenos data-linenos=" 73 "></span> <span class=n>versions</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span>
<span class=linenos data-linenos=" 74 "></span> <span class=n>hooks_only</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span>
<span class=linenos data-linenos=" 75 "></span> <span class=n>clean</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span>
<span class=linenos data-linenos=" 76 "></span> <span class=n>clean_hooks_after</span><span class=o>=</span><span class=kc>None</span><span class=p>,</span>
<span class=linenos data-linenos=" 77 "></span> <span class=n>clean_only</span><span class=o>=</span><span class=kc>False</span><span class=p>,</span>
<span class=linenos data-linenos=" 78 "></span> <span class=p>)</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=nb>str</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]:</span>
<span class=linenos data-linenos=" 79 "></span> <span class=c1># Fail early for invalid project metadata</span>
<span class=linenos data-linenos=" 80 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>validate_fields</span><span class=p>()</span>
<span class=linenos data-linenos=" 81 "></span>
<span class=linenos data-linenos=" 82 "></span> <span class=k>if</span> <span class=n>directory</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos=" 83 "></span> <span class=k>if</span> <span class=n>BuildEnvVars</span><span class=o>.</span><span class=n>LOCATION</span> <span class=ow>in</span> <span class=n>os</span><span class=o>.</span><span class=n>environ</span><span class=p>:</span>
<span class=linenos data-linenos=" 84 "></span> <span class=n>directory</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>normalize_build_directory</span><span class=p>(</span><span class=n>os</span><span class=o>.</span><span class=n>environ</span><span class=p>[</span><span class=n>BuildEnvVars</span><span class=o>.</span><span class=n>LOCATION</span><span class=p>])</span>
<span class=linenos data-linenos=" 85 "></span> <span class=k>else</span><span class=p>:</span>
<span class=linenos data-linenos=" 86 "></span> <span class=n>directory</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>directory</span>
<span class=linenos data-linenos=" 87 "></span>
<span class=linenos data-linenos=" 88 "></span> <span class=k>if</span> <span class=ow>not</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>isdir</span><span class=p>(</span><span class=n>directory</span><span class=p>):</span>
<span class=linenos data-linenos=" 89 "></span> <span class=n>os</span><span class=o>.</span><span class=n>makedirs</span><span class=p>(</span><span class=n>directory</span><span class=p>)</span>
<span class=linenos data-linenos=" 90 "></span>
<span class=linenos data-linenos=" 91 "></span> <span class=n>version_api</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>get_version_api</span><span class=p>()</span>
<span class=linenos data-linenos=" 92 "></span>
<span class=linenos data-linenos=" 93 "></span> <span class=k>if</span> <span class=ow>not</span> <span class=n>versions</span><span class=p>:</span>
<span class=linenos data-linenos=" 94 "></span> <span class=n>versions</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>versions</span>
<span class=linenos data-linenos=" 95 "></span> <span class=k>else</span><span class=p>:</span>
<span class=linenos data-linenos=" 96 "></span> <span class=n>unknown_versions</span> <span class=o>=</span> <span class=nb>set</span><span class=p>(</span><span class=n>versions</span><span class=p>)</span> <span class=o>-</span> <span class=nb>set</span><span class=p>(</span><span class=n>version_api</span><span class=p>)</span>
<span class=linenos data-linenos=" 97 "></span> <span class=k>if</span> <span class=n>unknown_versions</span><span class=p>:</span>
<span class=linenos data-linenos=" 98 "></span> <span class=k>raise</span> <span class=ne>ValueError</span><span class=p>(</span>
<span class=linenos data-linenos=" 99 "></span> <span class=sa>f</span><span class=s1>'Unknown versions for target `</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=si>}</span><span class=s1>`: </span><span class=si>{</span><span class=s2>", "</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=nb>map</span><span class=p>(</span><span class=nb>str</span><span class=p>,</span> <span class=nb>sorted</span><span class=p>(</span><span class=n>unknown_versions</span><span class=p>)))</span><span class=si>}</span><span class=s1>'</span>
<span class=linenos data-linenos="100 "></span> <span class=p>)</span>
<span class=linenos data-linenos="101 "></span>
<span class=linenos data-linenos="102 "></span> <span class=k>if</span> <span class=n>hooks_only</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="103 "></span> <span class=n>hooks_only</span> <span class=o>=</span> <span class=n>env_var_enabled</span><span class=p>(</span><span class=n>BuildEnvVars</span><span class=o>.</span><span class=n>HOOKS_ONLY</span><span class=p>)</span>
<span class=linenos data-linenos="104 "></span>
<span class=linenos data-linenos="105 "></span> <span class=n>configured_build_hooks</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>get_build_hooks</span><span class=p>(</span><span class=n>directory</span><span class=p>)</span>
<span class=linenos data-linenos="106 "></span> <span class=n>build_hooks</span> <span class=o>=</span> <span class=nb>list</span><span class=p>(</span><span class=n>configured_build_hooks</span><span class=o>.</span><span class=n>values</span><span class=p>())</span>
<span class=linenos data-linenos="107 "></span>
<span class=linenos data-linenos="108 "></span> <span class=k>if</span> <span class=n>clean_only</span><span class=p>:</span>
<span class=linenos data-linenos="109 "></span> <span class=n>clean</span> <span class=o>=</span> <span class=kc>True</span>
<span class=linenos data-linenos="110 "></span> <span class=k>elif</span> <span class=n>clean</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="111 "></span> <span class=n>clean</span> <span class=o>=</span> <span class=n>env_var_enabled</span><span class=p>(</span><span class=n>BuildEnvVars</span><span class=o>.</span><span class=n>CLEAN</span><span class=p>)</span>
<span class=linenos data-linenos="112 "></span> <span class=k>if</span> <span class=n>clean</span><span class=p>:</span>
<span class=linenos data-linenos="113 "></span> <span class=k>if</span> <span class=ow>not</span> <span class=n>hooks_only</span><span class=p>:</span>
<span class=linenos data-linenos="114 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>clean</span><span class=p>(</span><span class=n>directory</span><span class=p>,</span> <span class=n>versions</span><span class=p>)</span>
<span class=linenos data-linenos="115 "></span>
<span class=linenos data-linenos="116 "></span> <span class=k>for</span> <span class=n>build_hook</span> <span class=ow>in</span> <span class=n>build_hooks</span><span class=p>:</span>
<span class=linenos data-linenos="117 "></span> <span class=n>build_hook</span><span class=o>.</span><span class=n>clean</span><span class=p>(</span><span class=n>versions</span><span class=p>)</span>
<span class=linenos data-linenos="118 "></span>
<span class=linenos data-linenos="119 "></span> <span class=k>if</span> <span class=n>clean_only</span><span class=p>:</span>
<span class=linenos data-linenos="120 "></span> <span class=k>return</span>
<span class=linenos data-linenos="121 "></span>
<span class=linenos data-linenos="122 "></span> <span class=k>if</span> <span class=n>clean_hooks_after</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="123 "></span> <span class=n>clean_hooks_after</span> <span class=o>=</span> <span class=n>env_var_enabled</span><span class=p>(</span><span class=n>BuildEnvVars</span><span class=o>.</span><span class=n>CLEAN_HOOKS_AFTER</span><span class=p>)</span>
<span class=linenos data-linenos="124 "></span>
<span class=linenos data-linenos="125 "></span> <span class=k>for</span> <span class=n>version</span> <span class=ow>in</span> <span class=n>versions</span><span class=p>:</span>
<span class=linenos data-linenos="126 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>app</span><span class=o>.</span><span class=n>display_debug</span><span class=p>(</span><span class=sa>f</span><span class=s1>'Building `</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=si>}</span><span class=s1>` version `</span><span class=si>{</span><span class=n>version</span><span class=si>}</span><span class=s1>`'</span><span class=p>)</span>
<span class=linenos data-linenos="127 "></span>
<span class=linenos data-linenos="128 "></span> <span class=n>build_data</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>get_default_build_data</span><span class=p>()</span>
<span class=linenos data-linenos="129 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>set_build_data_defaults</span><span class=p>(</span><span class=n>build_data</span><span class=p>)</span>
<span class=linenos data-linenos="130 "></span>
<span class=linenos data-linenos="131 "></span> <span class=c1># Allow inspection of configured build hooks and the order in which they run</span>
<span class=linenos data-linenos="132 "></span> <span class=n>build_data</span><span class=p>[</span><span class=s1>'build_hooks'</span><span class=p>]</span> <span class=o>=</span> <span class=nb>tuple</span><span class=p>(</span><span class=n>configured_build_hooks</span><span class=p>)</span>
<span class=linenos data-linenos="133 "></span>
<span class=linenos data-linenos="134 "></span> <span class=c1># Execute all `initialize` build hooks</span>
<span class=linenos data-linenos="135 "></span> <span class=k>for</span> <span class=n>build_hook</span> <span class=ow>in</span> <span class=n>build_hooks</span><span class=p>:</span>
<span class=linenos data-linenos="136 "></span> <span class=n>build_hook</span><span class=o>.</span><span class=n>initialize</span><span class=p>(</span><span class=n>version</span><span class=p>,</span> <span class=n>build_data</span><span class=p>)</span>
<span class=linenos data-linenos="137 "></span>
<span class=linenos data-linenos="138 "></span> <span class=k>if</span> <span class=n>hooks_only</span><span class=p>:</span>
<span class=linenos data-linenos="139 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>app</span><span class=o>.</span><span class=n>display_debug</span><span class=p>(</span><span class=sa>f</span><span class=s1>'Only ran build hooks for `</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=si>}</span><span class=s1>` version `</span><span class=si>{</span><span class=n>version</span><span class=si>}</span><span class=s1>`'</span><span class=p>)</span>
<span class=linenos data-linenos="140 "></span> <span class=k>continue</span>
<span class=linenos data-linenos="141 "></span>
<span class=linenos data-linenos="142 "></span> <span class=c1># Build the artifact</span>
<span class=linenos data-linenos="143 "></span> <span class=k>with</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>set_build_data</span><span class=p>(</span><span class=n>build_data</span><span class=p>):</span>
<span class=linenos data-linenos="144 "></span> <span class=n>artifact</span> <span class=o>=</span> <span class=n>version_api</span><span class=p>[</span><span class=n>version</span><span class=p>](</span><span class=n>directory</span><span class=p>,</span> <span class=o>**</span><span class=n>build_data</span><span class=p>)</span>
<span class=linenos data-linenos="145 "></span>
<span class=linenos data-linenos="146 "></span> <span class=c1># Execute all `finalize` build hooks</span>
<span class=linenos data-linenos="147 "></span> <span class=k>for</span> <span class=n>build_hook</span> <span class=ow>in</span> <span class=n>build_hooks</span><span class=p>:</span>
<span class=linenos data-linenos="148 "></span> <span class=n>build_hook</span><span class=o>.</span><span class=n>finalize</span><span class=p>(</span><span class=n>version</span><span class=p>,</span> <span class=n>build_data</span><span class=p>,</span> <span class=n>artifact</span><span class=p>)</span>
<span class=linenos data-linenos="149 "></span>
<span class=linenos data-linenos="150 "></span> <span class=k>if</span> <span class=n>clean_hooks_after</span><span class=p>:</span>
<span class=linenos data-linenos="151 "></span> <span class=k>for</span> <span class=n>build_hook</span> <span class=ow>in</span> <span class=n>build_hooks</span><span class=p>:</span>
<span class=linenos data-linenos="152 "></span> <span class=n>build_hook</span><span class=o>.</span><span class=n>clean</span><span class=p>([</span><span class=n>version</span><span class=p>])</span>
<span class=linenos data-linenos="153 "></span>
<span class=linenos data-linenos="154 "></span> <span class=k>yield</span> <span class=n>artifact</span>
<span class=linenos data-linenos="155 "></span>
<span class=linenos data-linenos="156 "></span> <span class=k>def</span> <span class=nf>recurse_included_files</span><span class=p>(</span><span class=bp>self</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=n>IncludedFile</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]:</span>
<span class=linenos data-linenos="157 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="158 "></span><span class=sd> Returns a consistently generated series of file objects for every file that should be distributed. Each file</span>
<span class=linenos data-linenos="159 "></span><span class=sd> object has three `str` attributes:</span>
<span class=linenos data-linenos="160 "></span>
<span class=linenos data-linenos="161 "></span><span class=sd> - `path` - the absolute path</span>
<span class=linenos data-linenos="162 "></span><span class=sd> - `relative_path` - the path relative to the project root; will be an empty string for external files</span>
<span class=linenos data-linenos="163 "></span><span class=sd> - `distribution_path` - the path to be distributed as</span>
<span class=linenos data-linenos="164 "></span><span class=sd> """</span>
<span class=linenos data-linenos="165 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>only_include</span><span class=p>:</span>
<span class=linenos data-linenos="166 "></span> <span class=k>yield from</span> <span class=bp>self</span><span class=o>.</span><span class=n>recurse_explicit_files</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>only_include</span><span class=p>)</span>
<span class=linenos data-linenos="167 "></span> <span class=k>else</span><span class=p>:</span>
<span class=linenos data-linenos="168 "></span> <span class=k>yield from</span> <span class=bp>self</span><span class=o>.</span><span class=n>recurse_project_files</span><span class=p>()</span>
<span class=linenos data-linenos="169 "></span>
<span class=linenos data-linenos="170 "></span> <span class=k>yield from</span> <span class=bp>self</span><span class=o>.</span><span class=n>recurse_forced_files</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_force_include</span><span class=p>())</span>
<span class=linenos data-linenos="171 "></span>
<span class=linenos data-linenos="172 "></span> <span class=k>def</span> <span class=nf>recurse_project_files</span><span class=p>(</span><span class=bp>self</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=n>IncludedFile</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]:</span>
<span class=linenos data-linenos="173 "></span> <span class=k>for</span> <span class=n>root</span><span class=p>,</span> <span class=n>dirs</span><span class=p>,</span> <span class=n>files</span> <span class=ow>in</span> <span class=n>safe_walk</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>):</span>
<span class=linenos data-linenos="174 "></span> <span class=n>relative_path</span> <span class=o>=</span> <span class=n>get_relative_path</span><span class=p>(</span><span class=n>root</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>)</span>
<span class=linenos data-linenos="175 "></span>
<span class=linenos data-linenos="176 "></span> <span class=n>dirs</span><span class=p>[:]</span> <span class=o>=</span> <span class=nb>sorted</span><span class=p>(</span><span class=n>d</span> <span class=k>for</span> <span class=n>d</span> <span class=ow>in</span> <span class=n>dirs</span> <span class=k>if</span> <span class=ow>not</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>directory_is_excluded</span><span class=p>(</span><span class=n>d</span><span class=p>,</span> <span class=n>relative_path</span><span class=p>))</span>
<span class=linenos data-linenos="177 "></span>
<span class=linenos data-linenos="178 "></span> <span class=n>files</span><span class=o>.</span><span class=n>sort</span><span class=p>()</span>
<span class=linenos data-linenos="179 "></span> <span class=n>is_package</span> <span class=o>=</span> <span class=s1>'__init__.py'</span> <span class=ow>in</span> <span class=n>files</span>
<span class=linenos data-linenos="180 "></span> <span class=k>for</span> <span class=n>f</span> <span class=ow>in</span> <span class=n>files</span><span class=p>:</span>
<span class=linenos data-linenos="181 "></span> <span class=n>relative_file_path</span> <span class=o>=</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=n>relative_path</span><span class=p>,</span> <span class=n>f</span><span class=p>)</span>
<span class=linenos data-linenos="182 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>include_path</span><span class=p>(</span><span class=n>relative_file_path</span><span class=p>,</span> <span class=n>is_package</span><span class=o>=</span><span class=n>is_package</span><span class=p>):</span>
<span class=linenos data-linenos="183 "></span> <span class=k>yield</span> <span class=n>IncludedFile</span><span class=p>(</span>
<span class=linenos data-linenos="184 "></span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=n>root</span><span class=p>,</span> <span class=n>f</span><span class=p>),</span> <span class=n>relative_file_path</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_distribution_path</span><span class=p>(</span><span class=n>relative_file_path</span><span class=p>)</span>
<span class=linenos data-linenos="185 "></span> <span class=p>)</span>
<span class=linenos data-linenos="186 "></span>
<span class=linenos data-linenos="187 "></span> <span class=k>def</span> <span class=nf>recurse_forced_files</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>inclusion_map</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=n>IncludedFile</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]:</span>
<span class=linenos data-linenos="188 "></span> <span class=k>for</span> <span class=n>source</span><span class=p>,</span> <span class=n>target_path</span> <span class=ow>in</span> <span class=n>inclusion_map</span><span class=o>.</span><span class=n>items</span><span class=p>():</span>
<span class=linenos data-linenos="189 "></span> <span class=n>external</span> <span class=o>=</span> <span class=ow>not</span> <span class=n>source</span><span class=o>.</span><span class=n>startswith</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>)</span>
<span class=linenos data-linenos="190 "></span> <span class=k>if</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>isfile</span><span class=p>(</span><span class=n>source</span><span class=p>):</span>
<span class=linenos data-linenos="191 "></span> <span class=k>yield</span> <span class=n>IncludedFile</span><span class=p>(</span>
<span class=linenos data-linenos="192 "></span> <span class=n>source</span><span class=p>,</span>
<span class=linenos data-linenos="193 "></span> <span class=s1>''</span> <span class=k>if</span> <span class=n>external</span> <span class=k>else</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>relpath</span><span class=p>(</span><span class=n>source</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>),</span>
<span class=linenos data-linenos="194 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_distribution_path</span><span class=p>(</span><span class=n>target_path</span><span class=p>),</span>
<span class=linenos data-linenos="195 "></span> <span class=p>)</span>
<span class=linenos data-linenos="196 "></span> <span class=k>elif</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>isdir</span><span class=p>(</span><span class=n>source</span><span class=p>):</span>
<span class=linenos data-linenos="197 "></span> <span class=k>for</span> <span class=n>root</span><span class=p>,</span> <span class=n>dirs</span><span class=p>,</span> <span class=n>files</span> <span class=ow>in</span> <span class=n>safe_walk</span><span class=p>(</span><span class=n>source</span><span class=p>):</span>
<span class=linenos data-linenos="198 "></span> <span class=n>relative_directory</span> <span class=o>=</span> <span class=n>get_relative_path</span><span class=p>(</span><span class=n>root</span><span class=p>,</span> <span class=n>source</span><span class=p>)</span>
<span class=linenos data-linenos="199 "></span>
<span class=linenos data-linenos="200 "></span> <span class=n>dirs</span><span class=p>[:]</span> <span class=o>=</span> <span class=nb>sorted</span><span class=p>(</span><span class=n>d</span> <span class=k>for</span> <span class=n>d</span> <span class=ow>in</span> <span class=n>dirs</span> <span class=k>if</span> <span class=n>d</span> <span class=ow>not</span> <span class=ow>in</span> <span class=n>EXCLUDED_DIRECTORIES</span><span class=p>)</span>
<span class=linenos data-linenos="201 "></span>
<span class=linenos data-linenos="202 "></span> <span class=n>files</span><span class=o>.</span><span class=n>sort</span><span class=p>()</span>
<span class=linenos data-linenos="203 "></span> <span class=k>for</span> <span class=n>f</span> <span class=ow>in</span> <span class=n>files</span><span class=p>:</span>
<span class=linenos data-linenos="204 "></span> <span class=n>relative_file_path</span> <span class=o>=</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=n>target_path</span><span class=p>,</span> <span class=n>relative_directory</span><span class=p>,</span> <span class=n>f</span><span class=p>)</span>
<span class=linenos data-linenos="205 "></span> <span class=k>if</span> <span class=ow>not</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>path_is_reserved</span><span class=p>(</span><span class=n>relative_file_path</span><span class=p>):</span>
<span class=linenos data-linenos="206 "></span> <span class=k>yield</span> <span class=n>IncludedFile</span><span class=p>(</span>
<span class=linenos data-linenos="207 "></span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=n>root</span><span class=p>,</span> <span class=n>f</span><span class=p>),</span>
<span class=linenos data-linenos="208 "></span> <span class=s1>''</span> <span class=k>if</span> <span class=n>external</span> <span class=k>else</span> <span class=n>relative_file_path</span><span class=p>,</span>
<span class=linenos data-linenos="209 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_distribution_path</span><span class=p>(</span><span class=n>relative_file_path</span><span class=p>),</span>
<span class=linenos data-linenos="210 "></span> <span class=p>)</span>
<span class=linenos data-linenos="211 "></span>
<span class=linenos data-linenos="212 "></span> <span class=k>def</span> <span class=nf>recurse_explicit_files</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>inclusion_map</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=n>IncludedFile</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]:</span>
<span class=linenos data-linenos="213 "></span> <span class=k>for</span> <span class=n>source</span><span class=p>,</span> <span class=n>target_path</span> <span class=ow>in</span> <span class=n>inclusion_map</span><span class=o>.</span><span class=n>items</span><span class=p>():</span>
<span class=linenos data-linenos="214 "></span> <span class=n>external</span> <span class=o>=</span> <span class=ow>not</span> <span class=n>source</span><span class=o>.</span><span class=n>startswith</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>)</span>
<span class=linenos data-linenos="215 "></span> <span class=k>if</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>isfile</span><span class=p>(</span><span class=n>source</span><span class=p>):</span>
<span class=linenos data-linenos="216 "></span> <span class=k>yield</span> <span class=n>IncludedFile</span><span class=p>(</span>
<span class=linenos data-linenos="217 "></span> <span class=n>source</span><span class=p>,</span>
<span class=linenos data-linenos="218 "></span> <span class=s1>''</span> <span class=k>if</span> <span class=n>external</span> <span class=k>else</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>relpath</span><span class=p>(</span><span class=n>source</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>),</span>
<span class=linenos data-linenos="219 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_distribution_path</span><span class=p>(</span><span class=n>target_path</span><span class=p>),</span>
<span class=linenos data-linenos="220 "></span> <span class=p>)</span>
<span class=linenos data-linenos="221 "></span> <span class=k>elif</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>isdir</span><span class=p>(</span><span class=n>source</span><span class=p>):</span>
<span class=linenos data-linenos="222 "></span> <span class=k>for</span> <span class=n>root</span><span class=p>,</span> <span class=n>dirs</span><span class=p>,</span> <span class=n>files</span> <span class=ow>in</span> <span class=n>safe_walk</span><span class=p>(</span><span class=n>source</span><span class=p>):</span>
<span class=linenos data-linenos="223 "></span> <span class=n>relative_directory</span> <span class=o>=</span> <span class=n>get_relative_path</span><span class=p>(</span><span class=n>root</span><span class=p>,</span> <span class=n>source</span><span class=p>)</span>
<span class=linenos data-linenos="224 "></span>
<span class=linenos data-linenos="225 "></span> <span class=n>dirs</span><span class=p>[:]</span> <span class=o>=</span> <span class=nb>sorted</span><span class=p>(</span><span class=n>d</span> <span class=k>for</span> <span class=n>d</span> <span class=ow>in</span> <span class=n>dirs</span> <span class=k>if</span> <span class=n>d</span> <span class=ow>not</span> <span class=ow>in</span> <span class=n>EXCLUDED_DIRECTORIES</span><span class=p>)</span>
<span class=linenos data-linenos="226 "></span>
<span class=linenos data-linenos="227 "></span> <span class=n>files</span><span class=o>.</span><span class=n>sort</span><span class=p>()</span>
<span class=linenos data-linenos="228 "></span> <span class=n>is_package</span> <span class=o>=</span> <span class=s1>'__init__.py'</span> <span class=ow>in</span> <span class=n>files</span>
<span class=linenos data-linenos="229 "></span> <span class=k>for</span> <span class=n>f</span> <span class=ow>in</span> <span class=n>files</span><span class=p>:</span>
<span class=linenos data-linenos="230 "></span> <span class=n>relative_file_path</span> <span class=o>=</span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=n>target_path</span><span class=p>,</span> <span class=n>relative_directory</span><span class=p>,</span> <span class=n>f</span><span class=p>)</span>
<span class=linenos data-linenos="231 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>include_path</span><span class=p>(</span><span class=n>relative_file_path</span><span class=p>,</span> <span class=n>explicit</span><span class=o>=</span><span class=kc>True</span><span class=p>,</span> <span class=n>is_package</span><span class=o>=</span><span class=n>is_package</span><span class=p>):</span>
<span class=linenos data-linenos="232 "></span> <span class=k>yield</span> <span class=n>IncludedFile</span><span class=p>(</span>
<span class=linenos data-linenos="233 "></span> <span class=n>os</span><span class=o>.</span><span class=n>path</span><span class=o>.</span><span class=n>join</span><span class=p>(</span><span class=n>root</span><span class=p>,</span> <span class=n>f</span><span class=p>),</span>
<span class=linenos data-linenos="234 "></span> <span class=s1>''</span> <span class=k>if</span> <span class=n>external</span> <span class=k>else</span> <span class=n>relative_file_path</span><span class=p>,</span>
<span class=linenos data-linenos="235 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_distribution_path</span><span class=p>(</span><span class=n>relative_file_path</span><span class=p>),</span>
<span class=linenos data-linenos="236 "></span> <span class=p>)</span>
<span class=linenos data-linenos="237 "></span>
<span class=linenos data-linenos="238 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="239 "></span> <span class=k>def</span> <span class=nf>root</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="240 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="241 "></span><span class=sd> The root of the project tree.</span>
<span class=linenos data-linenos="242 "></span><span class=sd> """</span>
<span class=linenos data-linenos="243 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__root</span>
<span class=linenos data-linenos="244 "></span>
<span class=linenos data-linenos="245 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="246 "></span> <span class=k>def</span> <span class=nf>plugin_manager</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="247 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__plugin_manager</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="248 "></span> <span class=kn>from</span> <span class=nn>hatchling.plugin.manager</span> <span class=kn>import</span> <span class=n>PluginManager</span>
<span class=linenos data-linenos="249 "></span>
<span class=linenos data-linenos="250 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__plugin_manager</span> <span class=o>=</span> <span class=n>PluginManager</span><span class=p>()</span>
<span class=linenos data-linenos="251 "></span>
<span class=linenos data-linenos="252 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__plugin_manager</span>
<span class=linenos data-linenos="253 "></span>
<span class=linenos data-linenos="254 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="255 "></span> <span class=k>def</span> <span class=nf>metadata</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="256 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__metadata</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="257 "></span> <span class=kn>from</span> <span class=nn>hatchling.metadata.core</span> <span class=kn>import</span> <span class=n>ProjectMetadata</span>
<span class=linenos data-linenos="258 "></span>
<span class=linenos data-linenos="259 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__metadata</span> <span class=o>=</span> <span class=n>ProjectMetadata</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>plugin_manager</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>__raw_config</span><span class=p>)</span>
<span class=linenos data-linenos="260 "></span>
<span class=linenos data-linenos="261 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__metadata</span>
<span class=linenos data-linenos="262 "></span>
<span class=linenos data-linenos="263 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="264 "></span> <span class=k>def</span> <span class=nf>app</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="265 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="266 "></span><span class=sd> An instance of [Application](../utilities.md#hatchling.bridge.app.Application).</span>
<span class=linenos data-linenos="267 "></span><span class=sd> """</span>
<span class=linenos data-linenos="268 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="269 "></span> <span class=kn>from</span> <span class=nn>hatchling.bridge.app</span> <span class=kn>import</span> <span class=n>Application</span>
<span class=linenos data-linenos="270 "></span>
<span class=linenos data-linenos="271 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span> <span class=o>=</span> <span class=n>Application</span><span class=p>()</span><span class=o>.</span><span class=n>get_safe_application</span><span class=p>()</span>
<span class=linenos data-linenos="272 "></span>
<span class=linenos data-linenos="273 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span>
<span class=linenos data-linenos="274 "></span>
<span class=linenos data-linenos="275 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="276 "></span> <span class=k>def</span> <span class=nf>raw_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="277 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__raw_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="278 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__raw_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>config</span>
<span class=linenos data-linenos="279 "></span>
<span class=linenos data-linenos="280 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__raw_config</span>
<span class=linenos data-linenos="281 "></span>
<span class=linenos data-linenos="282 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="283 "></span> <span class=k>def</span> <span class=nf>project_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="284 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="285 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>core</span><span class=o>.</span><span class=n>config</span>
<span class=linenos data-linenos="286 "></span>
<span class=linenos data-linenos="287 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_config</span>
<span class=linenos data-linenos="288 "></span>
<span class=linenos data-linenos="289 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="290 "></span> <span class=k>def</span> <span class=nf>hatch_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="291 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__hatch_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="292 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__hatch_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>hatch</span><span class=o>.</span><span class=n>config</span>
<span class=linenos data-linenos="293 "></span>
<span class=linenos data-linenos="294 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__hatch_config</span>
<span class=linenos data-linenos="295 "></span>
<span class=linenos data-linenos="296 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="297 "></span> <span class=k>def</span> <span class=nf>config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="298 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="299 "></span><span class=sd> An instance of [BuilderConfig](../utilities.md#hatchling.builders.config.BuilderConfig).</span>
<span class=linenos data-linenos="300 "></span><span class=sd> """</span>
<span class=linenos data-linenos="301 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="302 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>get_config_class</span><span class=p>()(</span>
<span class=linenos data-linenos="303 "></span> <span class=bp>self</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>build_config</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>target_config</span>
<span class=linenos data-linenos="304 "></span> <span class=p>)</span>
<span class=linenos data-linenos="305 "></span>
<span class=linenos data-linenos="306 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span>
<span class=linenos data-linenos="307 "></span>
<span class=linenos data-linenos="308 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="309 "></span> <span class=k>def</span> <span class=nf>build_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="310 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="311 "></span><span class=sd> === ":octicons-file-code-16: pyproject.toml"</span>
<span class=linenos data-linenos="312 "></span>
<span class=linenos data-linenos="313 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="314 "></span><span class=sd> [tool.hatch.build]</span>
<span class=linenos data-linenos="315 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="316 "></span>
<span class=linenos data-linenos="317 "></span><span class=sd> === ":octicons-file-code-16: hatch.toml"</span>
<span class=linenos data-linenos="318 "></span>
<span class=linenos data-linenos="319 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="320 "></span><span class=sd> [build]</span>
<span class=linenos data-linenos="321 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="322 "></span><span class=sd> """</span>
<span class=linenos data-linenos="323 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="324 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>hatch</span><span class=o>.</span><span class=n>build_config</span>
<span class=linenos data-linenos="325 "></span>
<span class=linenos data-linenos="326 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span>
<span class=linenos data-linenos="327 "></span>
<span class=linenos data-linenos="328 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="329 "></span> <span class=k>def</span> <span class=nf>target_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="330 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="331 "></span><span class=sd> === ":octicons-file-code-16: pyproject.toml"</span>
<span class=linenos data-linenos="332 "></span>
<span class=linenos data-linenos="333 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="334 "></span><span class=sd> [tool.hatch.build.targets.&lt;PLUGIN_NAME&gt;]</span>
<span class=linenos data-linenos="335 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="336 "></span>
<span class=linenos data-linenos="337 "></span><span class=sd> === ":octicons-file-code-16: hatch.toml"</span>
<span class=linenos data-linenos="338 "></span>
<span class=linenos data-linenos="339 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="340 "></span><span class=sd> [build.targets.&lt;PLUGIN_NAME&gt;]</span>
<span class=linenos data-linenos="341 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="342 "></span><span class=sd> """</span>
<span class=linenos data-linenos="343 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="344 "></span> <span class=n>target_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>hatch</span><span class=o>.</span><span class=n>build_targets</span><span class=o>.</span><span class=n>get</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=p>,</span> <span class=p>{})</span>
<span class=linenos data-linenos="345 "></span> <span class=k>if</span> <span class=ow>not</span> <span class=nb>isinstance</span><span class=p>(</span><span class=n>target_config</span><span class=p>,</span> <span class=nb>dict</span><span class=p>):</span>
<span class=linenos data-linenos="346 "></span> <span class=k>raise</span> <span class=ne>TypeError</span><span class=p>(</span><span class=sa>f</span><span class=s1>'Field `tool.hatch.build.targets.</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=si>}</span><span class=s1>` must be a table'</span><span class=p>)</span>
<span class=linenos data-linenos="347 "></span>
<span class=linenos data-linenos="348 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span> <span class=o>=</span> <span class=n>target_config</span>
<span class=linenos data-linenos="349 "></span>
<span class=linenos data-linenos="350 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span>
<span class=linenos data-linenos="351 "></span>
<span class=linenos data-linenos="352 "></span> <span class=nd>@property</span>
<span class=linenos data-linenos="353 "></span> <span class=k>def</span> <span class=nf>project_id</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="354 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_id</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="355 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_id</span> <span class=o>=</span> <span class=sa>f</span><span class=s1>'</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>normalize_file_name_component</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>core</span><span class=o>.</span><span class=n>name</span><span class=p>)</span><span class=si>}</span><span class=s1>-</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>version</span><span class=si>}</span><span class=s1>'</span>
<span class=linenos data-linenos="356 "></span>
<span class=linenos data-linenos="357 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__project_id</span>
<span class=linenos data-linenos="358 "></span>
<span class=linenos data-linenos="359 "></span> <span class=k>def</span> <span class=nf>get_build_hooks</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>directory</span><span class=p>):</span>
<span class=linenos data-linenos="360 "></span> <span class=n>configured_build_hooks</span> <span class=o>=</span> <span class=p>{}</span>
<span class=linenos data-linenos="361 "></span> <span class=k>for</span> <span class=n>hook_name</span><span class=p>,</span> <span class=n>config</span> <span class=ow>in</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>hook_config</span><span class=o>.</span><span class=n>items</span><span class=p>():</span>
<span class=linenos data-linenos="362 "></span> <span class=n>build_hook</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>plugin_manager</span><span class=o>.</span><span class=n>build_hook</span><span class=o>.</span><span class=n>get</span><span class=p>(</span><span class=n>hook_name</span><span class=p>)</span>
<span class=linenos data-linenos="363 "></span> <span class=k>if</span> <span class=n>build_hook</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="364 "></span> <span class=kn>from</span> <span class=nn>hatchling.plugin.exceptions</span> <span class=kn>import</span> <span class=n>UnknownPluginError</span>
<span class=linenos data-linenos="365 "></span>
<span class=linenos data-linenos="366 "></span> <span class=k>raise</span> <span class=n>UnknownPluginError</span><span class=p>(</span><span class=sa>f</span><span class=s1>'Unknown build hook: </span><span class=si>{</span><span class=n>hook_name</span><span class=si>}</span><span class=s1>'</span><span class=p>)</span>
<span class=linenos data-linenos="367 "></span>
<span class=linenos data-linenos="368 "></span> <span class=n>configured_build_hooks</span><span class=p>[</span><span class=n>hook_name</span><span class=p>]</span> <span class=o>=</span> <span class=n>build_hook</span><span class=p>(</span>
<span class=linenos data-linenos="369 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>,</span> <span class=n>config</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=p>,</span> <span class=n>directory</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>app</span>
<span class=linenos data-linenos="370 "></span> <span class=p>)</span>
<span class=linenos data-linenos="371 "></span>
<span class=linenos data-linenos="372 "></span> <span class=k>return</span> <span class=n>configured_build_hooks</span>
<span class=linenos data-linenos="373 "></span>
<span class=linenos data-linenos="374 "></span> <span class=nd>@abstractmethod</span>
<span class=linenos data-linenos="375 "></span> <span class=k>def</span> <span class=nf>get_version_api</span><span class=p>(</span><span class=bp>self</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=nb>dict</span><span class=p>[</span><span class=nb>str</span><span class=p>,</span> <span class=n>Callable</span><span class=p>]:</span>
<span class=linenos data-linenos="376 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="377 "></span><span class=sd> A mapping of `str` versions to a callable that is used for building.</span>
<span class=linenos data-linenos="378 "></span><span class=sd> Each callable must have the following signature:</span>
<span class=linenos data-linenos="379 "></span>
<span class=linenos data-linenos="380 "></span><span class=sd> ```python</span>
<span class=linenos data-linenos="381 "></span><span class=sd> def ...(build_dir: str, build_data: dict) -&gt; str:</span>
<span class=linenos data-linenos="382 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="383 "></span>
<span class=linenos data-linenos="384 "></span><span class=sd> The return value must be the absolute path to the built artifact.</span>
<span class=linenos data-linenos="385 "></span><span class=sd> """</span>
<span class=linenos data-linenos="386 "></span>
<span class=linenos data-linenos="387 "></span> <span class=k>def</span> <span class=nf>get_default_versions</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="388 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="389 "></span><span class=sd> A list of versions to build when users do not specify any, defaulting to all versions.</span>
<span class=linenos data-linenos="390 "></span><span class=sd> """</span>
<span class=linenos data-linenos="391 "></span> <span class=k>return</span> <span class=nb>list</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>get_version_api</span><span class=p>())</span>
<span class=linenos data-linenos="392 "></span>
<span class=linenos data-linenos="393 "></span> <span class=k>def</span> <span class=nf>get_default_build_data</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="394 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="395 "></span><span class=sd> A mapping that can be modified by [build hooks](../build-hook/reference.md) to influence the behavior of builds.</span>
<span class=linenos data-linenos="396 "></span><span class=sd> """</span>
<span class=linenos data-linenos="397 "></span> <span class=k>return</span> <span class=p>{}</span>
<span class=linenos data-linenos="398 "></span>
<span class=linenos data-linenos="399 "></span> <span class=k>def</span> <span class=nf>set_build_data_defaults</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>build_data</span><span class=p>):</span>
<span class=linenos data-linenos="400 "></span> <span class=n>build_data</span><span class=o>.</span><span class=n>setdefault</span><span class=p>(</span><span class=s1>'artifacts'</span><span class=p>,</span> <span class=p>[])</span>
<span class=linenos data-linenos="401 "></span> <span class=n>build_data</span><span class=o>.</span><span class=n>setdefault</span><span class=p>(</span><span class=s1>'force_include'</span><span class=p>,</span> <span class=p>{})</span>
<span class=linenos data-linenos="402 "></span>
<span class=linenos data-linenos="403 "></span> <span class=k>def</span> <span class=nf>clean</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>directory</span><span class=p>,</span> <span class=n>versions</span><span class=p>):</span>
<span class=linenos data-linenos="404 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="405 "></span><span class=sd> Called before builds if the `-c`/`--clean` flag was passed to the</span>
<span class=linenos data-linenos="406 "></span><span class=sd> [`build`](../../cli/reference.md#hatch-build) command.</span>
<span class=linenos data-linenos="407 "></span><span class=sd> """</span>
<span class=linenos data-linenos="408 "></span>
<span class=linenos data-linenos="409 "></span> <span class=nd>@classmethod</span>
<span class=linenos data-linenos="410 "></span> <span class=k>def</span> <span class=nf>get_config_class</span><span class=p>(</span><span class=bp>cls</span><span class=p>):</span>
<span class=linenos data-linenos="411 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="412 "></span><span class=sd> Must return a subclass of [BuilderConfig](../utilities.md#hatchling.builders.config.BuilderConfig).</span>
<span class=linenos data-linenos="413 "></span><span class=sd> """</span>
<span class=linenos data-linenos="414 "></span> <span class=k>return</span> <span class=n>BuilderConfig</span>
<span class=linenos data-linenos="415 "></span>
<span class=linenos data-linenos="416 "></span> <span class=nd>@staticmethod</span>
<span class=linenos data-linenos="417 "></span> <span class=k>def</span> <span class=nf>normalize_file_name_component</span><span class=p>(</span><span class=n>file_name</span><span class=p>):</span>
<span class=linenos data-linenos="418 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="419 "></span><span class=sd> https://peps.python.org/pep-0427/#escaping-and-unicode</span>
<span class=linenos data-linenos="420 "></span><span class=sd> """</span>
<span class=linenos data-linenos="421 "></span> <span class=k>return</span> <span class=n>re</span><span class=o>.</span><span class=n>sub</span><span class=p>(</span><span class=sa>r</span><span class=s1>'[^\w\d.]+'</span><span class=p>,</span> <span class=s1>'_'</span><span class=p>,</span> <span class=n>file_name</span><span class=p>,</span> <span class=n>re</span><span class=o>.</span><span class=n>UNICODE</span><span class=p>)</span>
</code></pre></div> </details> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.PLUGIN_NAME> <code class="highlight language-python"><span class=n>PLUGIN_NAME</span> <span class=o>=</span> <span class=s1>''</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.PLUGIN_NAME title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>The name used for selection.</p> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.app> <code class="highlight language-python"><span class=n>app</span><span class=p>()</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.app title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>An instance of <a href=../../utilities/#hatchling.bridge.app.Application>Application</a>.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="263 "></span><span class=nd>@property</span>
<span class=linenos data-linenos="264 "></span><span class=k>def</span> <span class=nf>app</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="265 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="266 "></span><span class=sd> An instance of [Application](../utilities.md#hatchling.bridge.app.Application).</span>
<span class=linenos data-linenos="267 "></span><span class=sd> """</span>
<span class=linenos data-linenos="268 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="269 "></span> <span class=kn>from</span> <span class=nn>hatchling.bridge.app</span> <span class=kn>import</span> <span class=n>Application</span>
<span class=linenos data-linenos="270 "></span>
<span class=linenos data-linenos="271 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span> <span class=o>=</span> <span class=n>Application</span><span class=p>()</span><span class=o>.</span><span class=n>get_safe_application</span><span class=p>()</span>
<span class=linenos data-linenos="272 "></span>
<span class=linenos data-linenos="273 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__app</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.root> <code class="highlight language-python"><span class=n>root</span><span class=p>()</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.root title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>The root of the project tree.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="238 "></span><span class=nd>@property</span>
<span class=linenos data-linenos="239 "></span><span class=k>def</span> <span class=nf>root</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="240 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="241 "></span><span class=sd> The root of the project tree.</span>
<span class=linenos data-linenos="242 "></span><span class=sd> """</span>
<span class=linenos data-linenos="243 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__root</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.build_config> <code class="highlight language-python"><span class=n>build_config</span><span class=p>()</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.build_config title="Permanent link"></a></h3> <div class="doc doc-contents"> <div class="tabbed-set tabbed-alternate" data-tabs=1:2><input checked=checked id=hatchling.builders.plugin.interface.BuilderInterface.build_config--__tabbed_1_1 name=hatchling.builders.plugin.interface.BuilderInterface.build_config--__tabbed_1 type=radio><input id=hatchling.builders.plugin.interface.BuilderInterface.build_config--__tabbed_1_2 name=hatchling.builders.plugin.interface.BuilderInterface.build_config--__tabbed_1 type=radio><div class=tabbed-labels><label for=hatchling.builders.plugin.interface.BuilderInterface.build_config--__tabbed_1_1><span class=twemoji><svg viewbox="0 0 16 16" xmlns=http://www.w3.org/2000/svg><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 0 0-.011-.013l-2.914-2.914a.272.272 0 0 0-.013-.011zM5.72 6.72a.75.75 0 0 0 0 1.06l1.47 1.47-1.47 1.47a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0zM3.28 7.78a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 0 0 1.06-1.06L1.81 9.25l1.47-1.47z" fill-rule=evenodd></path></svg></span> pyproject.toml</label><label for=hatchling.builders.plugin.interface.BuilderInterface.build_config--__tabbed_1_2><span class=twemoji><svg viewbox="0 0 16 16" xmlns=http://www.w3.org/2000/svg><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 0 0-.011-.013l-2.914-2.914a.272.272 0 0 0-.013-.011zM5.72 6.72a.75.75 0 0 0 0 1.06l1.47 1.47-1.47 1.47a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0zM3.28 7.78a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 0 0 1.06-1.06L1.81 9.25l1.47-1.47z" fill-rule=evenodd></path></svg></span> hatch.toml</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[tool.hatch.build]</span><span class=w></span>
</code></pre></div> </div> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[build]</span><span class=w></span>
</code></pre></div> </div> </div> </div> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="308 "></span><span class=nd>@property</span>
<span class=linenos data-linenos="309 "></span><span class=k>def</span> <span class=nf>build_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="310 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="311 "></span><span class=sd> === ":octicons-file-code-16: pyproject.toml"</span>
<span class=linenos data-linenos="312 "></span>
<span class=linenos data-linenos="313 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="314 "></span><span class=sd> [tool.hatch.build]</span>
<span class=linenos data-linenos="315 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="316 "></span>
<span class=linenos data-linenos="317 "></span><span class=sd> === ":octicons-file-code-16: hatch.toml"</span>
<span class=linenos data-linenos="318 "></span>
<span class=linenos data-linenos="319 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="320 "></span><span class=sd> [build]</span>
<span class=linenos data-linenos="321 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="322 "></span><span class=sd> """</span>
<span class=linenos data-linenos="323 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="324 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>hatch</span><span class=o>.</span><span class=n>build_config</span>
<span class=linenos data-linenos="325 "></span>
<span class=linenos data-linenos="326 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__build_config</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.target_config> <code class="highlight language-python"><span class=n>target_config</span><span class=p>()</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.target_config title="Permanent link"></a></h3> <div class="doc doc-contents"> <div class="tabbed-set tabbed-alternate" data-tabs=1:2><input checked=checked id=hatchling.builders.plugin.interface.BuilderInterface.target_config--__tabbed_1_1 name=hatchling.builders.plugin.interface.BuilderInterface.target_config--__tabbed_1 type=radio><input id=hatchling.builders.plugin.interface.BuilderInterface.target_config--__tabbed_1_2 name=hatchling.builders.plugin.interface.BuilderInterface.target_config--__tabbed_1 type=radio><div class=tabbed-labels><label for=hatchling.builders.plugin.interface.BuilderInterface.target_config--__tabbed_1_1><span class=twemoji><svg viewbox="0 0 16 16" xmlns=http://www.w3.org/2000/svg><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 0 0-.011-.013l-2.914-2.914a.272.272 0 0 0-.013-.011zM5.72 6.72a.75.75 0 0 0 0 1.06l1.47 1.47-1.47 1.47a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0zM3.28 7.78a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 0 0 1.06-1.06L1.81 9.25l1.47-1.47z" fill-rule=evenodd></path></svg></span> pyproject.toml</label><label for=hatchling.builders.plugin.interface.BuilderInterface.target_config--__tabbed_1_2><span class=twemoji><svg viewbox="0 0 16 16" xmlns=http://www.w3.org/2000/svg><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 0 0-.011-.013l-2.914-2.914a.272.272 0 0 0-.013-.011zM5.72 6.72a.75.75 0 0 0 0 1.06l1.47 1.47-1.47 1.47a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0zM3.28 7.78a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 0 0 1.06-1.06L1.81 9.25l1.47-1.47z" fill-rule=evenodd></path></svg></span> hatch.toml</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[tool.hatch.build.targets.&lt;PLUGIN_NAME&gt;]</span><span class=w></span>
</code></pre></div> </div> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[build.targets.&lt;PLUGIN_NAME&gt;]</span><span class=w></span>
</code></pre></div> </div> </div> </div> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="328 "></span><span class=nd>@property</span>
<span class=linenos data-linenos="329 "></span><span class=k>def</span> <span class=nf>target_config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="330 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="331 "></span><span class=sd> === ":octicons-file-code-16: pyproject.toml"</span>
<span class=linenos data-linenos="332 "></span>
<span class=linenos data-linenos="333 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="334 "></span><span class=sd> [tool.hatch.build.targets.&lt;PLUGIN_NAME&gt;]</span>
<span class=linenos data-linenos="335 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="336 "></span>
<span class=linenos data-linenos="337 "></span><span class=sd> === ":octicons-file-code-16: hatch.toml"</span>
<span class=linenos data-linenos="338 "></span>
<span class=linenos data-linenos="339 "></span><span class=sd> ```toml</span>
<span class=linenos data-linenos="340 "></span><span class=sd> [build.targets.&lt;PLUGIN_NAME&gt;]</span>
<span class=linenos data-linenos="341 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="342 "></span><span class=sd> """</span>
<span class=linenos data-linenos="343 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="344 "></span> <span class=n>target_config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>metadata</span><span class=o>.</span><span class=n>hatch</span><span class=o>.</span><span class=n>build_targets</span><span class=o>.</span><span class=n>get</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=p>,</span> <span class=p>{})</span>
<span class=linenos data-linenos="345 "></span> <span class=k>if</span> <span class=ow>not</span> <span class=nb>isinstance</span><span class=p>(</span><span class=n>target_config</span><span class=p>,</span> <span class=nb>dict</span><span class=p>):</span>
<span class=linenos data-linenos="346 "></span> <span class=k>raise</span> <span class=ne>TypeError</span><span class=p>(</span><span class=sa>f</span><span class=s1>'Field `tool.hatch.build.targets.</span><span class=si>{</span><span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=si>}</span><span class=s1>` must be a table'</span><span class=p>)</span>
<span class=linenos data-linenos="347 "></span>
<span class=linenos data-linenos="348 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span> <span class=o>=</span> <span class=n>target_config</span>
<span class=linenos data-linenos="349 "></span>
<span class=linenos data-linenos="350 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__target_config</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.config> <code class="highlight language-python"><span class=n>config</span><span class=p>()</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.config title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>An instance of <a href=../../utilities/#hatchling.builders.config.BuilderConfig>BuilderConfig</a>.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="296 "></span><span class=nd>@property</span>
<span class=linenos data-linenos="297 "></span><span class=k>def</span> <span class=nf>config</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="298 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="299 "></span><span class=sd> An instance of [BuilderConfig](../utilities.md#hatchling.builders.config.BuilderConfig).</span>
<span class=linenos data-linenos="300 "></span><span class=sd> """</span>
<span class=linenos data-linenos="301 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span> <span class=ow>is</span> <span class=kc>None</span><span class=p>:</span>
<span class=linenos data-linenos="302 "></span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span> <span class=o>=</span> <span class=bp>self</span><span class=o>.</span><span class=n>get_config_class</span><span class=p>()(</span>
<span class=linenos data-linenos="303 "></span> <span class=bp>self</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>root</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>PLUGIN_NAME</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>build_config</span><span class=p>,</span> <span class=bp>self</span><span class=o>.</span><span class=n>target_config</span>
<span class=linenos data-linenos="304 "></span> <span class=p>)</span>
<span class=linenos data-linenos="305 "></span>
<span class=linenos data-linenos="306 "></span> <span class=k>return</span> <span class=bp>self</span><span class=o>.</span><span class=n>__config</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.get_config_class> <code class="highlight language-python"><span class=n>get_config_class</span><span class=p>()</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-classmethod"><code>classmethod</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.get_config_class title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>Must return a subclass of <a href=../../utilities/#hatchling.builders.config.BuilderConfig>BuilderConfig</a>.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="409 "></span><span class=nd>@classmethod</span>
<span class=linenos data-linenos="410 "></span><span class=k>def</span> <span class=nf>get_config_class</span><span class=p>(</span><span class=bp>cls</span><span class=p>):</span>
<span class=linenos data-linenos="411 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="412 "></span><span class=sd> Must return a subclass of [BuilderConfig](../utilities.md#hatchling.builders.config.BuilderConfig).</span>
<span class=linenos data-linenos="413 "></span><span class=sd> """</span>
<span class=linenos data-linenos="414 "></span> <span class=k>return</span> <span class=n>BuilderConfig</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.get_version_api> <code class="highlight language-python"><span class=n>get_version_api</span><span class=p>()</span> <span class=o>-&gt;</span> <span class=nb>dict</span><span class=p>[</span><span class=nb>str</span><span class=p>,</span> <span class=n>Callable</span><span class=p>]</span></code> <span class="doc doc-labels"> <small class="doc doc-label doc-label-abstractmethod"><code>abstractmethod</code></small> </span> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.get_version_api title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>A mapping of <code>str</code> versions to a callable that is used for building. Each callable must have the following signature:</p> <div class=highlight><pre><span></span><code><span class=k>def</span> <span class=o>...</span><span class=p>(</span><span class=n>build_dir</span><span class=p>:</span> <span class=nb>str</span><span class=p>,</span> <span class=n>build_data</span><span class=p>:</span> <span class=nb>dict</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=nb>str</span><span class=p>:</span>
</code></pre></div> <p>The return value must be the absolute path to the built artifact.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="374 "></span><span class=nd>@abstractmethod</span>
<span class=linenos data-linenos="375 "></span><span class=k>def</span> <span class=nf>get_version_api</span><span class=p>(</span><span class=bp>self</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=nb>dict</span><span class=p>[</span><span class=nb>str</span><span class=p>,</span> <span class=n>Callable</span><span class=p>]:</span>
<span class=linenos data-linenos="376 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="377 "></span><span class=sd> A mapping of `str` versions to a callable that is used for building.</span>
<span class=linenos data-linenos="378 "></span><span class=sd> Each callable must have the following signature:</span>
<span class=linenos data-linenos="379 "></span>
<span class=linenos data-linenos="380 "></span><span class=sd> ```python</span>
<span class=linenos data-linenos="381 "></span><span class=sd> def ...(build_dir: str, build_data: dict) -&gt; str:</span>
<span class=linenos data-linenos="382 "></span><span class=sd> ```</span>
<span class=linenos data-linenos="383 "></span>
<span class=linenos data-linenos="384 "></span><span class=sd> The return value must be the absolute path to the built artifact.</span>
<span class=linenos data-linenos="385 "></span><span class=sd> """</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.get_default_versions> <code class="highlight language-python"><span class=n>get_default_versions</span><span class=p>()</span></code> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.get_default_versions title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>A list of versions to build when users do not specify any, defaulting to all versions.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="387 "></span><span class=k>def</span> <span class=nf>get_default_versions</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="388 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="389 "></span><span class=sd> A list of versions to build when users do not specify any, defaulting to all versions.</span>
<span class=linenos data-linenos="390 "></span><span class=sd> """</span>
<span class=linenos data-linenos="391 "></span> <span class=k>return</span> <span class=nb>list</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>get_version_api</span><span class=p>())</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.clean> <code class="highlight language-python"><span class=n>clean</span><span class=p>(</span><span class=n>directory</span><span class=p>,</span> <span class=n>versions</span><span class=p>)</span></code> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.clean title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>Called before builds if the <code>-c</code>/<code>--clean</code> flag was passed to the <a href=../../../cli/reference/#hatch-build><code>build</code></a> command.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="403 "></span><span class=k>def</span> <span class=nf>clean</span><span class=p>(</span><span class=bp>self</span><span class=p>,</span> <span class=n>directory</span><span class=p>,</span> <span class=n>versions</span><span class=p>):</span>
<span class=linenos data-linenos="404 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="405 "></span><span class=sd> Called before builds if the `-c`/`--clean` flag was passed to the</span>
<span class=linenos data-linenos="406 "></span><span class=sd> [`build`](../../cli/reference.md#hatch-build) command.</span>
<span class=linenos data-linenos="407 "></span><span class=sd> """</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.recurse_included_files> <code class="highlight language-python"><span class=n>recurse_included_files</span><span class=p>()</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=n>IncludedFile</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]</span></code> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.recurse_included_files title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>Returns a consistently generated series of file objects for every file that should be distributed. Each file object has three <code>str</code> attributes:</p> <ul> <li><code>path</code> - the absolute path</li> <li><code>relative_path</code> - the path relative to the project root; will be an empty string for external files</li> <li><code>distribution_path</code> - the path to be distributed as</li> </ul> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="156 "></span><span class=k>def</span> <span class=nf>recurse_included_files</span><span class=p>(</span><span class=bp>self</span><span class=p>)</span> <span class=o>-&gt;</span> <span class=n>Generator</span><span class=p>[</span><span class=n>IncludedFile</span><span class=p>,</span> <span class=kc>None</span><span class=p>,</span> <span class=kc>None</span><span class=p>]:</span>
<span class=linenos data-linenos="157 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="158 "></span><span class=sd> Returns a consistently generated series of file objects for every file that should be distributed. Each file</span>
<span class=linenos data-linenos="159 "></span><span class=sd> object has three `str` attributes:</span>
<span class=linenos data-linenos="160 "></span>
<span class=linenos data-linenos="161 "></span><span class=sd> - `path` - the absolute path</span>
<span class=linenos data-linenos="162 "></span><span class=sd> - `relative_path` - the path relative to the project root; will be an empty string for external files</span>
<span class=linenos data-linenos="163 "></span><span class=sd> - `distribution_path` - the path to be distributed as</span>
<span class=linenos data-linenos="164 "></span><span class=sd> """</span>
<span class=linenos data-linenos="165 "></span> <span class=k>if</span> <span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>only_include</span><span class=p>:</span>
<span class=linenos data-linenos="166 "></span> <span class=k>yield from</span> <span class=bp>self</span><span class=o>.</span><span class=n>recurse_explicit_files</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>only_include</span><span class=p>)</span>
<span class=linenos data-linenos="167 "></span> <span class=k>else</span><span class=p>:</span>
<span class=linenos data-linenos="168 "></span> <span class=k>yield from</span> <span class=bp>self</span><span class=o>.</span><span class=n>recurse_project_files</span><span class=p>()</span>
<span class=linenos data-linenos="169 "></span>
<span class=linenos data-linenos="170 "></span> <span class=k>yield from</span> <span class=bp>self</span><span class=o>.</span><span class=n>recurse_forced_files</span><span class=p>(</span><span class=bp>self</span><span class=o>.</span><span class=n>config</span><span class=o>.</span><span class=n>get_force_include</span><span class=p>())</span>
</code></pre></div> </details> </div> </div> <div class="doc doc-object doc-function"> <h3 class="doc doc-heading" id=hatchling.builders.plugin.interface.BuilderInterface.get_default_build_data> <code class="highlight language-python"><span class=n>get_default_build_data</span><span class=p>()</span></code> <a class=headerlink href=#hatchling.builders.plugin.interface.BuilderInterface.get_default_build_data title="Permanent link"></a></h3> <div class="doc doc-contents"> <p>A mapping that can be modified by <a href=../../build-hook/reference/ >build hooks</a> to influence the behavior of builds.</p> <details class=quote> <summary>Source code in <code>hatchling/builders/plugin/interface.py</code></summary> <div class=highlight><pre><span></span><code><span class=linenos data-linenos="393 "></span><span class=k>def</span> <span class=nf>get_default_build_data</span><span class=p>(</span><span class=bp>self</span><span class=p>):</span>
<span class=linenos data-linenos="394 "></span> <span class=sd>"""</span>
<span class=linenos data-linenos="395 "></span><span class=sd> A mapping that can be modified by [build hooks](../build-hook/reference.md) to influence the behavior of builds.</span>
<span class=linenos data-linenos="396 "></span><span class=sd> """</span>
<span class=linenos data-linenos="397 "></span> <span class=k>return</span> <span class=p>{}</span>
</code></pre></div> </details> </div> </div> </div> </div> </div> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Date of last update"> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1-2.1-2M12.5 7v5.2l4 2.4-1 1L11 13V7h1.5M11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2v1.8Z"></path></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 8, 2022</span> </span> </aside> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> </main> <footer class=md-footer> <nav aria-label=Footer class="md-footer__inner md-grid"> <a aria-label="Previous: About" class="md-footer__link md-footer__link--prev" href=../../about/ rel=prev> <div class="md-footer__button md-icon"> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"></path></svg> </div> <div class=md-footer__title> <div class=md-ellipsis> <span class=md-footer__direction> Previous </span> About </div> </div> </a> <a aria-label="Next: Wheel" class="md-footer__link md-footer__link--next" href=../wheel/ rel=next> <div class=md-footer__title> <div class=md-ellipsis> <span class=md-footer__direction> Next </span> Wheel </div> </div> <div class="md-footer__button md-icon"> <svg viewbox="0 0 24 24" xmlns=http://www.w3.org/2000/svg><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"></path></svg> </div> </a> </nav> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright © Ofek Lev 2017-present </div> <div> Logo by <a href=https://openai.com/dall-e-2/ rel=noopener target=_blank> DALL·E </a> and <a href=https://boriscrowther.com/ rel=noopener target=_blank> Boris Crowther </a> </div> Made with <a href=https://squidfunk.github.io/mkdocs-material/ rel=noopener target=_blank> Material for MkDocs </a> </div> <div class=md-social> <a class=md-social__link href=https://github.com/ofek rel=noopener target=_blank title=github.com> <svg viewbox="0 0 480 512" xmlns=http://www.w3.org/2000/svg><!-- Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"></path></svg> </a> <a class=md-social__link href=https://ofek.dev/words/ rel=noopener target=_blank title=ofek.dev> <svg viewbox="0 0 512 512" xmlns=http://www.w3.org/2000/svg><!-- Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M192 32c0 17.7 14.3 32 32 32 123.7 0 224 100.3 224 224 0 17.7 14.3 32 32 32s32-14.3 32-32C512 128.9 383.1 0 224 0c-17.7 0-32 14.3-32 32zm0 96c0 17.7 14.3 32 32 32 70.7 0 128 57.3 128 128 0 17.7 14.3 32 32 32s32-14.3 32-32c0-106-86-192-192-192-17.7 0-32 14.3-32 32zm-96 16c0-26.5-21.5-48-48-48S0 117.5 0 144v224c0 79.5 64.5 144 144 144s144-64.5 144-144-64.5-144-144-144h-16v96h16c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48V144z"></path></svg> </a> <a class=md-social__link href=https://twitter.com/Ofekmeister rel=noopener target=_blank title=twitter.com> <svg viewbox="0 0 512 512" xmlns=http://www.w3.org/2000/svg><!-- Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg> </a> <a class=md-social__link href=https://www.linkedin.com/in/ofeklev/ rel=noopener target=_blank title=www.linkedin.com> <svg viewbox="0 0 448 512" xmlns=http://www.w3.org/2000/svg><!-- Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"></path></svg> </a> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../../..", "features": ["navigation.sections", "navigation.expand", "navigation.tabs", "navigation.tabs.sticky", "navigation.instant"], "search": "../../../assets/javascripts/workers/search.720157f5.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "version": {"provider": "mike"}}</script> <script src=../../../assets/javascripts/bundle.b7e8f764.min.js></script> <script>document$.subscribe(() => {const lightbox = GLightbox({"touchNavigation": true, "loop": false, "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom"});})</script></body> </html>