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

Custom sdist command extends from setuptools instead of distutils #125

Merged
merged 2 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased
### Fixed
- Fix some files unexpectedly missing from `sdist` command output. [#125](https://github.com/PyO3/setuptools-rust/pull/125)

## 0.12.0 (2020-03-08)
### Packaging
- Bump minimum Python version to Python 3.6.
Expand Down
8 changes: 4 additions & 4 deletions setuptools_rust/setuptools_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
from distutils.command.sdist import sdist
from setuptools.command.sdist import sdist
import sys
import subprocess

Expand Down Expand Up @@ -39,8 +39,7 @@ def initialize_options(self):
super().initialize_options()
self.vendor_crates = 0

def get_file_list(self):
super().get_file_list()
def make_distribution(self):
if self.vendor_crates:
manifest_paths = []
for ext in self.distribution.rust_extensions:
Expand Down Expand Up @@ -76,7 +75,7 @@ def get_file_list(self):
# Check whether `.cargo/config`/`.cargo/config.toml` already exists
existing_cargo_config = None
for filename in (f".cargo{os.sep}config", f".cargo{os.sep}config.toml"):
if filename in self.filelist.allfiles:
if filename in self.filelist.files:
existing_cargo_config = filename
break
if existing_cargo_config:
Expand All @@ -89,6 +88,7 @@ def get_file_list(self):
f.write(cargo_config)
self.filelist.append(vendor_path)
self.filelist.append(cargo_config_path)
super().make_distribution()
dist.cmdclass["sdist"] = sdist_rust_extension

build_ext_base_class = dist.cmdclass.get('build_ext', build_ext)
Expand Down