heroku-buildpack-python icon indicating copy to clipboard operation
heroku-buildpack-python copied to clipboard

Support pyproject.toml

Open cjolowicz opened this issue 6 years ago • 7 comments
trafficstars

Support PEP 517 package builds using the pyproject.toml file. This adds support for build backends other than setuptools, such as poetry and flit. This PR is a follow-up to #833.

There is not much to do here, because pip 19 already implements PEP 517-based builds.

  • Detect Python projects having only pyproject.toml and no requirements.txt or Pipfile.
  • Avoid editable installs, which are not compatible with pyproject.toml-style projects.
  • Add test cases for pyproject.toml-style projects managed by setuptools, poetry, and flit.

Note that while this PR does allow deploying poetry-based projects to Heroku, it does not use the pinned requirements from the poetry.lock file. Implementing support for poetry.lock is build backend-specific, and therefore left to be addressed by a follow-up PR.

See #796

Follow-ups:

  • #835 (Support poetry.lock)

CI is broken for PRs from another repository, see this comment. Please check the corresponding PR in my fork to verify CI:

  • cjolowicz/heroku-buildpack-python#14

cjolowicz avatar Aug 24 '19 12:08 cjolowicz

It would be good to add a test case for a pyproject.toml using setuptools as the build backend end.

~There could be a problem here because the buildpack uses a vendorized setuptools pinned at 39.0.1.~ On second thoughts, this should be fine because pip will use an isolated build using the setuptools version specified in the pyproject.toml.

Update: done (f845208)

cjolowicz avatar Aug 25 '19 13:08 cjolowicz

Rebased onto master (v157).

  • Tests were moved from test/run to test/run-features

cjolowicz avatar Sep 25 '19 08:09 cjolowicz

Rebased onto master (af860be62afc610aa24e6a1556ab21279d3f5d0b)

cjolowicz avatar Oct 03 '19 15:10 cjolowicz

Rebased onto master (93a620e6edacde750d32af6e3c8c3ad5e6800a40)

cjolowicz avatar Nov 24 '19 14:11 cjolowicz

Hi guys! Could you please add a comment on status of this and #796 Support for Poetry?

licht1stein avatar Apr 05 '20 16:04 licht1stein

For everyone who needs a quick fix:

You can either add an empty setup.py file to your project or a requirements.txt file with a dot (.) in it.

codingjoe avatar Sep 09 '22 16:09 codingjoe