Skip to content

Commit 2313175

Browse files
Custom sdist command extends from setuptools instead of distutils (#125)
* Custom sdist command extends from setuptools instead of distutils * Update CHANGELOG.md Co-authored-by: David Hewitt <[email protected]> Co-authored-by: David Hewitt <[email protected]>
1 parent fd4d83e commit 2313175

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
### Fixed
5+
- Fix some files unexpectedly missing from `sdist` command output. [#125](https://github.com/PyO3/setuptools-rust/pull/125)
6+
37
## 0.12.0 (2020-03-08)
48
### Packaging
59
- Bump minimum Python version to Python 3.6.

setuptools_rust/setuptools_ext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from setuptools.command.build_ext import build_ext
77
from setuptools.command.install import install
8-
from distutils.command.sdist import sdist
8+
from setuptools.command.sdist import sdist
99
import sys
1010
import subprocess
1111

@@ -39,8 +39,7 @@ def initialize_options(self):
3939
super().initialize_options()
4040
self.vendor_crates = 0
4141

42-
def get_file_list(self):
43-
super().get_file_list()
42+
def make_distribution(self):
4443
if self.vendor_crates:
4544
manifest_paths = []
4645
for ext in self.distribution.rust_extensions:
@@ -76,7 +75,7 @@ def get_file_list(self):
7675
# Check whether `.cargo/config`/`.cargo/config.toml` already exists
7776
existing_cargo_config = None
7877
for filename in (f".cargo{os.sep}config", f".cargo{os.sep}config.toml"):
79-
if filename in self.filelist.allfiles:
78+
if filename in self.filelist.files:
8079
existing_cargo_config = filename
8180
break
8281
if existing_cargo_config:
@@ -89,6 +88,7 @@ def get_file_list(self):
8988
f.write(cargo_config)
9089
self.filelist.append(vendor_path)
9190
self.filelist.append(cargo_config_path)
91+
super().make_distribution()
9292
dist.cmdclass["sdist"] = sdist_rust_extension
9393

9494
build_ext_base_class = dist.cmdclass.get('build_ext', build_ext)

0 commit comments

Comments
 (0)