[
https://issues.apache.org/jira/browse/BEAM-7746?focusedWorklogId=336422&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-336422
]
ASF GitHub Bot logged work on BEAM-7746:
----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Oct/19 19:34
Start Date: 30/Oct/19 19:34
Worklog Time Spent: 10m
Work Description: chadrik commented on pull request #9056: [BEAM-7746]
Add python type hints
URL: https://github.com/apache/beam/pull/9056#discussion_r340818787
##########
File path:
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
##########
@@ -1768,7 +1768,7 @@ class BeamModulePlugin implements Plugin<Project> {
project.exec { commandLine virtualenvCmd }
project.exec {
executable 'sh'
- args '-c', ". ${project.ext.envdir}/bin/activate && pip install
--retries 10 --upgrade tox==3.11.1 grpcio-tools==1.3.5"
+ args '-c', ". ${project.ext.envdir}/bin/activate && pip install
--retries 10 --upgrade tox==3.11.1 -r
${project.rootDir}/sdks/python/build-requirements.txt"
Review comment:
I touched on this in your other comment, but the big picture here is that
python lacks a *good solution for specifying build-time requirements: i.e.
deps required to run `setup.py`.
Entire ecosystems have been built up around solving this:
- https://poetry.eustace.io/
- https://snarky.ca/clarifying-pep-518/
- https://github.com/pypa/pip/issues/2381
One note from the last link:
> Pip 10 and later support build dependencies, but they have to be specified
in a pyproject.toml file.
To use that we'd have to change `python setup.py sdist` to use `pip`, which
makes me nervous. Certainly more than I'd want to change in this PR.
@robertwb may have some other input. I noticed from some comments there
was an earlier attempt to use the `setup_requires` field of `setup.py`, and
then it was dismantled. IIRC, `setup_requires` has a lot of crippling issues.
In my experience a `build-requirements.txt` is by far the simplest solution.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 336422)
Time Spent: 14h 10m (was: 14h)
> Add type hints to python code
> -----------------------------
>
> Key: BEAM-7746
> URL: https://issues.apache.org/jira/browse/BEAM-7746
> Project: Beam
> Issue Type: New Feature
> Components: sdk-py-core
> Reporter: Chad Dombrova
> Assignee: Chad Dombrova
> Priority: Major
> Time Spent: 14h 10m
> Remaining Estimate: 0h
>
> As a developer of the beam source code, I would like the code to use pep484
> type hints so that I can clearly see what types are required, get completion
> in my IDE, and enforce code correctness via a static analyzer like mypy.
> This may be considered a precursor to BEAM-7060
> Work has been started here: [https://github.com/apache/beam/pull/9056]
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)