Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build!: Declarative builds via pyproject.toml #17174

Merged
merged 7 commits into from
Jun 15, 2022

Conversation

gavindsouza
Copy link
Collaborator

@gavindsouza gavindsouza commented Jun 14, 2022

Changes

+ pyproject.toml
- setup.py
- requirements.txt

Words

There was an attempt to switch to declarative setup (2 years ago), which was to use
setup.cfg. However, we've made more progress in the "world of packaging"
since. Also, given we're using a pyproject.toml file already to govern
certain aspects of our project maintenance, it's probably a good time to
bring these things together. bye-bye to clutter and confusion in
maintaining multiple files and formats.

We've used setuptools to package frappe for the longest time. Maybe
since the first editable installation. However, setuptools doesn't support
PEP 660 yet which supports editable installs via pyproject file.

So why now? Primarily because I wanted to start tracking system
dependencies for Frappe. Doing so through pyproject file made the most
sense. This change seemed to be the obvious pre-requisite for the
upcoming changes to our packaging systems.

Refs

System dependency tracking: #13811
Moving app meta to toml: #15675
Flit docs: https://flit.pypa.io/en/latest/pyproject_toml.html
Previous attempt: #10773
Which build tool: https://stackoverflow.com/a/69711730/10309266
PEP 660: https://peps.python.org/pep-0660/

There was an attempt to switch to declarative setup, which was to use
setup.cfg. However, we've made more progress in the "world of packaging"
since. Also, given we're using a pyproject file already to govern
certain aspects of our project maintenance, it's probably a good time to
bring these things together. bye-bye to clutter and confusion in
maintaining multiple files and formats.

We've used setuptools to package frappe for the longest time. Maybe
since the first editable installation. Howver setuptools doesn't support
PEP 660 yet which supports editable installs via pyproject file.

So why now? Primarily because I wanted to start tracking system
dependencies for Frappe. Doing so through pyproject file made the most
sense. This change seemed to be the obvious pre-requisite for the
upcoming changes to our packaging systems.

Sys deps tracking: frappe#13811
Flit docs: https://flit.pypa.io/en/latest/pyproject_toml.html
Previous attempt: frappe#10773
Which build tool: https://stackoverflow.com/a/69711730/10309266
PEP 660: https://peps.python.org/pep-0660/
@gavindsouza gavindsouza requested review from a team and shariquerik and removed request for a team June 14, 2022 08:08
@gavindsouza
Copy link
Collaborator Author

Oops, gotta make bench ready for this first 😿

@gavindsouza gavindsouza marked this pull request as draft June 14, 2022 08:48
@gavindsouza gavindsouza changed the title build: Declarative builds via pyproject.toml build!: Declarative builds via pyproject.toml Jun 14, 2022
@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #17174 (6c8b22a) into develop (5affa22) will decrease coverage by 1.63%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop   #17174      +/-   ##
===========================================
- Coverage    54.45%   52.82%   -1.64%     
===========================================
  Files          754      752       -2     
  Lines        67782    67742      -40     
  Branches      5769     5765       -4     
===========================================
- Hits         36910    35783    -1127     
- Misses       26822    27813     +991     
- Partials      4050     4146      +96     
Flag Coverage Δ
server 60.97% <ø> (-1.83%) ⬇️
ui-tests 38.03% <ø> (-1.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

setup.py is maintained so that there is no hard dependency on bench
v5.11.0 and people get enough time to update their CLI. Hope the TODO
adds a subtle reminder for the future ;)
@gavindsouza
Copy link
Collaborator Author

Frappe is now compatible with bench v5.11.0 even without setup.py file. Re-added it so that this doesn't affect install for users having older versions of the Bench CLI.

@gavindsouza gavindsouza marked this pull request as ready for review June 14, 2022 12:55
pyproject.toml Show resolved Hide resolved
@gavindsouza gavindsouza force-pushed the pyproject-filt branch 2 times, most recently from 19ec394 to 1c6b6e1 Compare June 15, 2022 09:18
- Cache invalidated if any of the files change: *requirements.txt,
pyproject.toml, setup.py or setup.cfg
- Updated boilerplate for new apps too
@gavindsouza
Copy link
Collaborator Author

ERPNext CI (just in case...) - https://github.com/frappe/erpnext/actions/runs/2501569276

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants