Skip to content

Conversation

@samuelgarcia
Copy link
Contributor

@samuelgarcia samuelgarcia commented Oct 5, 2022

Hi @apdavison @JuliaSprenger
I think the new trend is to move from dynamic setup (setup.py) to static declaration (pyproject.toml).
There somes peps about this and I think it help many tools for building and packaging.

Here a first draft for this.
Normally everything is centralize in pyproject.toml.

It still use setuptools for building but the medata come from pyproject.toml.

If you have time to make feeback on this. It would be cool.

EDIT:

  • I needed to remove python3.7 and some numpy for core-test. I guess that pyproject.toml is not compatible with theses
    versions.

Copy link
Member

@apdavison apdavison left a comment

Choose a reason for hiding this comment

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

This looks good. I think doc/source/conf.py will need to be updated to get the version string from the metadata file.


description = "Neo is a package for representing electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats"

readme = "README.rst"
Copy link
Member

Choose a reason for hiding this comment

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

I presume this replaces the "long_description" field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

description is the short one from what I understand.
For the long one. I don't known how to include yet.
I forgot also about that.
Maybe the readme replace it no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This readme is also the readme in pypi. So yes this replace the long description.

@samuelgarcia
Copy link
Contributor Author

doc/source/conf.py will need to be updated to get the version string from the metadata file.

Oups. I also forgot that.
Is it still necessary in sphinx to put this variable or is it automatic now ?
Do when parse the pyproject.toml for this ?

@samuelgarcia
Copy link
Contributor Author

@apdavison : other question.
Do we keep this minimal setup.py ?

Or do we switch to ?

  • pip install . only instead of python setup.py install
  • pip install -e . only instead of python setup.py develop
  • build package of python with python -m build --wheel instead of python setup.py sdist

I will no modify NOT the doc because you are working inanother PR on it but maybe you could propagate this also no ?

pyproject.toml Outdated
maxwell = ['h5py']
biocam = ['h5py']

# TODO [all]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JuliaSprenger please note that I have not find a way to do the all the moment.

Copy link
Member

Choose a reason for hiding this comment

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

I think for implementing the 'all' keyword in this framework we need to duplicate the requirements here. It's not nice, but acceptable I think.

JuliaSprenger and others added 4 commits November 4, 2022 11:59
* master: (51 commits)
  Make rescale signature compatible with quantities 0.14.0
  Return to fail-fast: true
  remove combination of Python/NumPy which doesn't build on Github Actions
  Add Python 3.11 to test matrix
  fix deprecation warnings with NumPy 1.24
  update docs
  update test matrix following NEP29 + 1 year
  fix typo in "ebrains mirror" workflow
  Create ebrains.yml
  Update neo/test/iotest/common_io_test.py
  enable closing of dangling file ios
  move mutable class attributes to avoid stacking modifications across instances
  refactor klustakwik to use pathlib instead of os.path
  remove outdated imports
  update neuroshare tests to also work for neuroshareapiio
  update klustakwik tests to be reincluded in test runs
  make neurosharectypesio.py pathlib robust
  make neurosharectypesio.py pathlib robust
  harmonize parameters across neuroshareios
  Performance optimization: check test files once per TestClass and not once per test case
  ...

# Conflicts:
#	.github/workflows/core-test.yml
#	requirements.txt
#	setup.py
@apdavison apdavison changed the title Draft to move from setup.py to pyproject.toml Move from setup.py to pyproject.toml Feb 16, 2023
@apdavison apdavison merged commit d7e2ed8 into NeuralEnsemble:master Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants