Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
981fb480
Unverified
Commit
981fb480
authored
Mar 07, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PEP-517 compliant build api
parent
aac9fee8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
poetry/masonry/api.py
+43
-0
No files found.
poetry/masonry/api.py
0 → 100644
View file @
981fb480
"""
PEP-517 compliant buildsystem API
"""
import
logging
from
pathlib
import
Path
from
poetry
import
Poetry
from
poetry.io
import
NullIO
from
.builders
import
SdistBuilder
from
.builders
import
WheelBuilder
log
=
logging
.
getLogger
(
__name__
)
# PEP 517 specifies that the CWD will always be the source tree
poetry
=
Poetry
.
create
(
'.'
)
def
get_requires_for_build_wheel
(
config_settings
=
None
):
"""
Returns a list of requirements for building, as strings
"""
main
,
extras
=
SdistBuilder
.
convert_dependencies
(
poetry
.
package
.
requires
)
return
main
+
extras
# For now, we require all dependencies to build either a wheel or an sdist.
get_requires_for_build_sdist
=
get_requires_for_build_wheel
def
build_wheel
(
wheel_directory
,
config_settings
=
None
,
metadata_directory
=
None
):
"""Builds a wheel, places it in wheel_directory"""
info
=
WheelBuilder
.
make_in
(
poetry
,
NullIO
(),
Path
(
wheel_directory
))
return
info
.
file
.
name
def
build_sdist
(
sdist_directory
,
config_settings
=
None
):
"""Builds an sdist, places it in sdist_directory"""
path
=
SdistBuilder
(
poetry
,
NullIO
())
.
build
(
Path
(
sdist_directory
))
return
path
.
name
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment