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

MAINT: Use Black for formatting #1144

Merged
merged 5 commits into from
May 30, 2023
Merged

MAINT: Use Black for formatting #1144

merged 5 commits into from
May 30, 2023

Conversation

sappelhoff
Copy link
Member

PR Description

fixes #1143

Let's see how this goes.

Merge checklist

Maintainer, please confirm the following before merging.
If applicable:

  • All comments are resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • New contributors have been added to CITATION.cff
  • PR description includes phrase "closes <#issue-number>"

@hoechenberger
Copy link
Member

What's with the setuptools pinning..?

@sappelhoff
Copy link
Member Author

I'm getting:

/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/dist.py:543: UserWarning: The version specified ('"0.13.dev0"') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
Traceback (most recent call last):
  File "/home/stefanappelhoff/Desktop/bids/mne-bids/setup.py", line 24, in <module>
    setup(
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/command/sdist.py", line 48, in run
    self.run_command('egg_info')
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options
    parsed_version = parse_version(self.egg_version)
  File "/home/stefanappelhoff/miniconda3/envs/mne_bids/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '-0.13.dev0-'

@hoechenberger
Copy link
Member

hoechenberger commented May 30, 2023

Our version naming / numbering doesn't conform to PEP-440, we should fix that instead of pinning setuptools to a version that accepts it :)

@sappelhoff
Copy link
Member Author

Agreed -- I don't see how we are violating the rules though: https://peps.python.org/pep-0440/#developmental-releases

@hoechenberger
Copy link
Member

'-0.13.dev0-'

the dashes maybe..?

@hoechenberger
Copy link
Member

Maybe @larsoner can help switch versioning over to setuptools-scm

@sappelhoff
Copy link
Member Author

the dashes maybe..?

they are inserted by the tool, our version seems fine:

__version__ = '0.13.dev0'

@sappelhoff
Copy link
Member Author

this package says our version is fine, too.

https://pypi.org/project/pep440/

@sappelhoff sappelhoff force-pushed the black branch 2 times, most recently from 6a4c01b to 026cf7b Compare May 30, 2023 10:26
@sappelhoff
Copy link
Member Author

Okay I think I caught it. It was a silly mistake in parsing the version, see:

version = line.split(' = ')[1].split('#')[0].strip('\'')

so you were right that something was fishy with the dashes, thanks!

@hoechenberger
Copy link
Member

Glad you figured it out!

Still, maybe we should try switching to setuptools-scm like we did for MNE-Python and MNE-BIDS-Pipeline. Seems so much more convenient and can make the release process easier.

@sappelhoff
Copy link
Member Author

I'll "rebase and merge" this one once tests pass :-)

Don't squash and merge, please!

@sappelhoff sappelhoff enabled auto-merge (rebase) May 30, 2023 11:04
@@ -0,0 +1 @@
58d9cf0b3a916af3e48fbb63b85b699c998c7f7a
Copy link
Member

Choose a reason for hiding this comment

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

FYI a rebase and merge will change the relevant commit number

Copy link
Member

Choose a reason for hiding this comment

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

(at least it will assuming it actually does a rebase... if it's already up to date maybe it won't?)

Copy link
Member Author

Choose a reason for hiding this comment

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

oh damn, so I should create a merge commit? Thanks!

@sappelhoff sappelhoff disabled auto-merge May 30, 2023 11:09
@sappelhoff sappelhoff enabled auto-merge May 30, 2023 11:10
@sappelhoff sappelhoff merged commit 5b3b92c into mne-tools:main May 30, 2023
@sappelhoff sappelhoff deleted the black branch May 30, 2023 11:18
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.

Use Black for formatting
3 participants