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

Fix build with the "upload" feature disabled #548

Merged
merged 1 commit into from
May 21, 2021
Merged
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
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ use human_panic::setup_panic;
#[cfg(feature = "password-storage")]
use keyring::{Keyring, KeyringError};
use maturin::{
develop, get_metadata_for_distribution, get_supported_version_for_distribution,
source_distribution, write_dist_info, BridgeModel, BuildOptions, BuiltWheelMetadata, CargoToml,
Manylinux, Metadata21, PathWriter, PyProjectToml, PythonInterpreter, Target,
develop, source_distribution, write_dist_info, BridgeModel, BuildOptions, CargoToml, Manylinux,
Metadata21, PathWriter, PyProjectToml, PythonInterpreter, Target,
};
use std::env;
use std::path::PathBuf;
use structopt::StructOpt;
#[cfg(feature = "upload")]
use {
maturin::{upload, Registry, UploadError},
maturin::{
get_metadata_for_distribution, get_supported_version_for_distribution, upload,
BuiltWheelMetadata, Registry, UploadError,
},
reqwest::Url,
rpassword,
std::io,
Expand Down Expand Up @@ -310,6 +312,7 @@ enum Opt {
///
/// It is mostly similar to `twine upload`, but can only upload python wheels
/// and source distributions.
#[cfg(feature = "upload")]
#[structopt(name = "upload")]
Upload {
#[structopt(flatten)]
Expand Down Expand Up @@ -648,6 +651,7 @@ fn run() -> Result<()> {
.context("Failed to build source distribution")?;
}
Opt::Pep517(subcommand) => pep517(subcommand)?,
#[cfg(feature = "upload")]
Opt::Upload { publish, files } => {
if files.is_empty() {
println!("⚠ Warning: No files given, exiting.");
Expand Down