Skip to content

Conversation

@yochem
Copy link

@yochem yochem commented Oct 1, 2025

I'm not entirely sure if support for setup.py can be dropped, but I leave that up to the maintainers. This can replace the following files:

MANIFEST.in
setup.py
setup.cfg

Copy link
Collaborator

@fschrempf fschrempf left a comment

Choose a reason for hiding this comment

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

Thanks for your work! I'm not a Python packaging expert, so my feedback capabilities are limited, but I found some problems running this on Python 3.13.7 with setuptools 80.9.0.

@yochem
Copy link
Author

yochem commented Oct 3, 2025

Thanks for your comments! I'll take a look at it this weekend and do some further testing.

@yochem
Copy link
Author

yochem commented Oct 6, 2025

I've incorporated your requested changes and can confirm it can now be installed "from source" in a GitHub Codespace with the following tools/versions:

  • Ubuntu 24.04.2
  • python 3.12.1
  • pip 23.2.1

Copy link
Collaborator

@fschrempf fschrempf left a comment

Choose a reason for hiding this comment

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

Thanks for keeping up the good work and sorry for the delay. Here are two more suggestions.

@doceme Do you have any general objections? Would you mind if I merge this?

keywords = ["SPI", "Linux", "SPI device"]

[build-system]
requires = ["setuptools>=61.0"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the other changes, we are now depending on a more recent version of setuptools, so this should be lifted to v80.

Suggested change
requires = ["setuptools>=61.0"]
requires = ["setuptools>=80.0"]

Comment on lines +4 to +5
dynamic = ["readme"]
version = "3.8"
Copy link
Collaborator

@fschrempf fschrempf Oct 23, 2025

Choose a reason for hiding this comment

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

Instead of duplicating the version here, we can still parse it from the C file with a little overhead. I would suggest to do:

Suggested change
dynamic = ["readme"]
version = "3.8"
dynamic = ["readme", "version"]

And then keep the setup.py script with the following content to parse the version string from the C file and pass it to the setup routine:

#!/usr/bin/env python

from setuptools import setup

version = "0.0"

lines = [x for x in open("spidev_module.c").read().split("\n") if "#define" in x and "_VERSION_" in x and "\"" in x]

if len(lines) > 0:
    version = lines[0].split("\"")[1]
else:
    raise Exception("Unable to find _VERSION_ in spidev_module.c")

setup(
    version = version,
)

@fschrempf fschrempf self-assigned this Nov 3, 2025
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.

2 participants