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

[BUG] Package data missing with Setuptools 61 #3196

Closed
jaraco opened this issue Mar 25, 2022 · 5 comments · Fixed by #3202
Closed

[BUG] Package data missing with Setuptools 61 #3196

jaraco opened this issue Mar 25, 2022 · 5 comments · Fixed by #3202

Comments

@jaraco
Copy link
Member

jaraco commented Mar 25, 2022

I've been fighting building one of my projects this evening, finding that all of the package data is missing.

$ pip-run -q recapturedocs==5.0.1 -- -c "import recapturedocs, os; assert 'prod.conf' in os.listdir(os.path.dirname(recapturedocs.__file__))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError

But if I instead build with setuptools<61 (by changing the pyproject.toml), the content is present.

$ git -C ~/m/recapturedocs diff
diff --git a/pyproject.toml b/pyproject.toml
index 190b355..cfacc1a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,5 @@
 [build-system]
-requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"]
+requires = ["setuptools>=56,<61", "setuptools_scm[toml]>=3.4.1"]
 build-backend = "setuptools.build_meta"
 
 [tool.black]
$ pip-run -q ~/m/recapturedocs -- -c "import recapturedocs, os; assert 'prod.conf' in os.listdir(os.path.dirname(recapturedocs.__file__))"
$

I haven't yet had a chance to investigate why, but I wanted to register this issue.

@jaraco jaraco changed the title [BUG] Package data missing with Setuptools 60.10 [BUG] Package data missing with Setuptools 61 Mar 25, 2022
jaraco added a commit to jaraco/recapturedocs that referenced this issue Mar 25, 2022
@nabobalis
Copy link

nabobalis commented Mar 25, 2022

I have the same issue with a package and also use setuptools_scm to manage the package data. If I were to speculate, something has broken with the update to setuptools and the current version of setuptools_scm.

Having said that, I see the same issue with https://github.com/MAVENSDC/cdflib and that does not use setuptools_scm.

@domdfcoding
Copy link
Contributor

I'm having a similar issue (presumably the same cause). I use MANIFEST.in to control which files are included in the sdist and wheel, but MANIFEST.in now seems to be ignored for the wheel.

Using git bisect I found that the behaviour changed after 755e053; if I install the previous commit (83d11a1) everything works as expected.
Specifically, commenting out these two lines makes it work for me, even on main:

if not distribution.package_dir:
distribution.package_dir = options.package_dir # Filled by `find_packages`

Not sure why or what purpose those lines serve.

@abravalheri
Copy link
Contributor

Hi Jason, thank you very much for reporting this. I will work on it.

@abravalheri
Copy link
Contributor

Thank you very much @domdfcoding for investigating! That is very helpful.

These lines serve to ensure people can use version = attr: module.__version__ with auto-discovery, I was not expecting them to have this side effect. I will investigate more in depth.

@jaraco
Copy link
Member Author

jaraco commented Mar 26, 2022

Confirmed the fix works. Thanks for the quick response!

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 a pull request may close this issue.

4 participants