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

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

Merged
merged 6 commits into from
May 2, 2024

Conversation

GabrielBarberini
Copy link
Collaborator

Pull request type

  • ReadMe, Docs and GitHub updates
  • Other: python package installation config

Breaking change

  • No

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 GabrielBarberini requested a review from a team as a code owner April 26, 2024 14:15
@GabrielBarberini GabrielBarberini linked an issue Apr 26, 2024 that may be closed by this pull request
2 tasks
@GabrielBarberini GabrielBarberini force-pushed the 578-bld-change-setuppy-to-pyprojecttoml branch from e83d125 to 17997ab Compare April 26, 2024 18:31
@GabrielBarberini GabrielBarberini force-pushed the 578-bld-change-setuppy-to-pyprojecttoml branch from 17997ab to feb690d Compare April 26, 2024 18:37
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@GabrielBarberini GabrielBarberini changed the base branch from master to develop April 28, 2024 15:29
@GabrielBarberini GabrielBarberini force-pushed the 578-bld-change-setuppy-to-pyprojecttoml branch from fa1d86d to d143d81 Compare April 28, 2024 15:31
@GabrielBarberini
Copy link
Collaborator Author

@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

@GabrielBarberini GabrielBarberini force-pushed the 578-bld-change-setuppy-to-pyprojecttoml branch from d143d81 to 3671ff0 Compare April 28, 2024 16:12
removes setup.py

fixes pyproject typo

sets max line to 88 columns

Fix code style issues with Black

Revert to c955e81

addresses review comments

fixes optional dependencies

migrates flake and unit test rules to pyproject toml

addresses review comments
@GabrielBarberini GabrielBarberini force-pushed the 578-bld-change-setuppy-to-pyprojecttoml branch from 3671ff0 to 2ac512c Compare April 28, 2024 16:14
Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

❗ 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
@@             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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.X.0 milestone May 2, 2024
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR! Straight to the point, it solves what was requested in the issue.

We are deleting 3 files to stay with just a single 1, this is good!.
The .pylintrc file will still stand, but this is a strategical decision... Controlling pylint rules directly with the .pylintrc file must be a better idea in terms of scalability.

As I also made changes to the PR, I will ask you to wait for a second approval.
@phmbressan @MateusStano could one of you also review/approve this PR please?

Pay attention that we are deleting the setup.py file!!

@Gui-FernandesBR Gui-FernandesBR changed the title 578 bld change setup.py to pyproject.toml BLD: Change setup.py to pyproject.toml May 2, 2024
Copy link
Collaborator

@phmbressan phmbressan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Finally we have the updated Python install pyproject.toml. The removed "hidden files" from the project structure are a nice bonus.

CHANGELOG.md Outdated Show resolved Hide resolved
@Gui-FernandesBR Gui-FernandesBR added the Enhancement New feature or request, including adjustments in current codes label May 2, 2024
@GabrielBarberini GabrielBarberini merged commit 44e5ed8 into develop May 2, 2024
8 checks passed
@GabrielBarberini GabrielBarberini deleted the 578-bld-change-setuppy-to-pyprojecttoml branch May 2, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request, including adjustments in current codes
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

BLD: change setup.py to pyproject.toml
3 participants