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

Transition to pyproject.toml #443

Merged
merged 35 commits into from Jan 11, 2023
Merged

Transition to pyproject.toml #443

merged 35 commits into from Jan 11, 2023

Conversation

martinvonk
Copy link
Collaborator

Short Description

See #442

Checklist before PR can be merged:

@martinvonk
Copy link
Collaborator Author

Code still has to be moved to .src folder.

@martinvonk
Copy link
Collaborator Author

If there is a new Pastas version released and all pull requests are merged in the dev branch we can update this branch. Then we can move the pastas scripts to the src/ folder and finish this PR.

@dbrakenhoff
Copy link
Member

Is it really necessary to move the code to the src/ folder? This post suggests both (our current structure and the src-structure) are valid: https://godatadriven.com/blog/a-practical-guide-to-setuptools-and-pyproject-toml/?

setup.cfg Outdated Show resolved Hide resolved
Copy link
Member

@dbrakenhoff dbrakenhoff left a comment

Choose a reason for hiding this comment

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

See comments.

pyproject.toml Show resolved Hide resolved
@raoulcollenteur
Copy link
Member

Hi @martinvonk, now would be a good time to work on this PR ;-) I agree with @dbrakenhoff that if we can stick to the current folder structure and not use a src folder I would prefer that.

@martinvonk
Copy link
Collaborator Author

Hi @martinvonk, now would be a good time to work on this PR ;-) I agree with @dbrakenhoff that if we can stick to the current folder structure and not use a src folder I would prefer that.

Will continue working on this after #441 is merged.

On the /src layout this is worth a read: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/

@martinvonk martinvonk marked this pull request as ready for review January 10, 2023 13:57
__version__ update
add black formatting optoins
add setuptools as requirement
just to make life easy and make use pyproject.toml is used
update dependencies
@martinvonk
Copy link
Collaborator Author

martinvonk commented Jan 10, 2023

At this point the method works. Now we want to replace the requirements.txt files with the optional dependencies. @dbrakenhoff is gonna give it a try because I don't understand the rtd setup process (yet) :).

@dbrakenhoff
Copy link
Member

dbrakenhoff commented Jan 10, 2023

I was hoping to merge dev into this PR without all the changes showing up in this PR, but for some reason I didn't do that correctly...? Anyway, hopefully black linting passes now.

If I messed up, I'll have to reset to an older commit and redo the merge. But let's see how it goes first.

Last thing is that we should maybe document somewhere what the procedure now looks like to create a new Release.

  • where to update the pastas version
  • ... (any other steps?)

@martinvonk
Copy link
Collaborator Author

martinvonk commented Jan 10, 2023

Can we change these lines as well? Such that we can remove the requirements.txt files.

if [ -f requirements.ci.txt ]; then pip install -r requirements.ci.txt; fi

.. include:: ../../requirements.ci.txt

Regarding @dbrakenhoff comment:

  • where to update the pastas version

With this change the version is now updated only in the pyproject.toml file and no longer in version.py. The version update takes place only in one file so that's good.

pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@martinvonk martinvonk left a comment

Choose a reason for hiding this comment

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

I think this is change going to work :)

So to list the changes:

  • setup.py is removed in favor of pyproject.toml
  • update the pastas version is now only done in the pyproject.toml file
  • the version.py file now uses importlib to determine the used pastas version
  • setup.cfg is added but empty (which makes maintenance easy). However we need an empty setup.cfg file, otherwise we can't do pip install -e .
  • remove requirements.txt files and get dependencies for readthedocs and ci from pyproject.toml
  • add black formatting checks

Copy link
Member

@raoulcollenteur raoulcollenteur left a comment

Choose a reason for hiding this comment

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

Couple of small changes as per the review comments. Particularly the Scipy version change. Then it should be good to go!

.github/workflows/ci.yml Show resolved Hide resolved
pastas/io/base.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@raoulcollenteur raoulcollenteur merged commit 00054dc into dev Jan 11, 2023
@raoulcollenteur raoulcollenteur deleted the 442-pyprojecttoml branch January 11, 2023 16:24
@martinvonk martinvonk self-assigned this Jan 19, 2023
@martinvonk martinvonk mentioned this pull request Jan 31, 2023
@martinvonk martinvonk added the code quality Related to code quality, testing, CI, project setup etc. label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Related to code quality, testing, CI, project setup etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants