RocketPy-Team / RocketPy

Next generation High-Power Rocketry 6-DOF Trajectory Simulation
https://docs.rocketpy.org/
MIT License
570 stars 137 forks source link

BLD: Change setup.py to pyproject.toml #589

Closed GabrielBarberini closed 2 months ago

GabrielBarberini commented 2 months ago

Pull request type

Breaking change

Additional information

Installation working after change on local machine:

➜  RocketPy git:(578-bld-change-setuppy-to-pyprojecttoml) ✗ python3 -m pip install . --break-system-packages
DEPRECATION: Loading egg at /usr/local/lib/python3.12/site-packages/interactive-0.0.6-py3.12.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at /usr/local/lib/python3.12/site-packages/Interactive-1.0.1-py3.12.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at /usr/local/lib/python3.12/site-packages/readertest_wrapper-0.0.10-py3.12.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
Processing /Users/gabriel.barberini/Documents/University/USP/extensao/RocketPy
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.13 in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (1.26.4)
Requirement already satisfied: scipy>=1.0 in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (1.12.0)
Requirement already satisfied: matplotlib>=3.0 in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (3.8.3)
Requirement already satisfied: netCDF4>=1.6.4 in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (1.6.5)
Requirement already satisfied: requests in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (2.28.1)
Requirement already satisfied: pytz in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (2024.1)
Requirement already satisfied: simplekml in /usr/local/lib/python3.12/site-packages (from rocketpy==1.2.2) (1.3.6)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (1.2.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (4.49.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (1.4.5)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (24.0)
Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (10.2.0)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.12/site-packages (from matplotlib>=3.0->rocketpy==1.2.2) (2.9.0.post0)
Requirement already satisfied: cftime in /usr/local/lib/python3.12/site-packages (from netCDF4>=1.6.4->rocketpy==1.2.2) (1.6.3)
Requirement already satisfied: certifi in /usr/local/lib/python3.12/site-packages (from netCDF4>=1.6.4->rocketpy==1.2.2) (2024.2.2)
Requirement already satisfied: charset-normalizer<3,>=2 in /usr/local/lib/python3.12/site-packages (from requests->rocketpy==1.2.2) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.12/site-packages (from requests->rocketpy==1.2.2) (3.6)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.12/site-packages (from requests->rocketpy==1.2.2) (1.26.18)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib>=3.0->rocketpy==1.2.2) (1.16.0)
Building wheels for collected packages: rocketpy
  Building wheel for rocketpy (pyproject.toml) ... done
  Created wheel for rocketpy: filename=rocketpy-1.2.2-py3-none-any.whl size=8082 sha256=0a016f393f2ec3b8e956db5cd0d14e0f38a57d64688ef4634b8bcd7f3cb9c323
  Stored in directory: /private/var/folders/tc/gwjqz6dx0gv2z49cls2hv2ww0000gp/T/pip-ephem-wheel-cache-uo874oe2/wheels/0f/73/f2/58132a149cac80cc0e267ceb9d37d1e461b9c8dad03329ffd0
Successfully built rocketpy
Installing collected packages: rocketpy
Successfully installed rocketpy-1.2.2
GabrielBarberini commented 2 months ago

@GabrielBarberini thanks for your contribution. This is a valuable change

  1. It's important that we merge this PR into the develop branch instead of the master, this would preserve the consistency in our git history. Could you rebase your changes to develop please? Unless it's a critical bug, we will always send to develop first.
  2. The .coveragerc (available on develop) and the .flake8 files could also be deleted as long as we transfer their rules to the new .toml file.
  3. I believe we should add this PR to the CHANGELOG.md file, it's relevant enough.
  1. Done
  2. coverage and flake8 migrated to pyproject.toml, but keep in mind raw flake8 has no support for pyproject, so I've added https://pypi.org/project/Flake8-pyproject/ to the requirement-tests.txt, to run flake under pyproject rules one will have to use $ flakep in the project root dir. Both pytest and flakep have been tested and seems to be working well after the change (worth a double check tho).
  3. Done as well
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.97%. Comparing base (bb0f46a) to head (1b9e950). Report is 14 commits behind head on develop.

:exclamation: Current head 1b9e950 differs from pull request most recent head 8d2f442. Consider uploading reports for the commit 8d2f442 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #589 +/- ## =========================================== - Coverage 72.99% 72.97% -0.02% =========================================== Files 59 57 -2 Lines 9543 9596 +53 =========================================== + Hits 6966 7003 +37 - Misses 2577 2593 +16 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.