Skip to content

Commit

Permalink
Merge 1d2f71f into 9e14168
Browse files Browse the repository at this point in the history
  • Loading branch information
svenfuchs committed Aug 21, 2019
2 parents 9e14168 + 1d2f71f commit a992608
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/dpl/providers/pypi.rb
Expand Up @@ -21,6 +21,7 @@ class Pypi < Provider
opt '--skip_existing', 'Do not overwrite an existing file with the same name on the server.'
opt '--upload_docs', 'Upload documentation', default: false, type: :boolean, note: 'most PyPI servers, including upload.pypi.org, do not support uploading documentation'
opt '--twine_check', 'Whether to run twine check', default: true
opt '--remove_build_dir', 'Remove the build dir after the upload', default: true
opt '--setuptools_version VER', format: VERSION
opt '--twine_version VER', format: VERSION
opt '--wheel_version VER', format: VERSION
Expand Down Expand Up @@ -61,7 +62,7 @@ def validate
def deploy
shell :twine_upload
upload_docs if upload_docs?
shell :rm_dist
shell :rm_dist if remove_build_dir?
end

private
Expand Down
9 changes: 5 additions & 4 deletions spec/dpl/providers/pypi_spec.rb
Expand Up @@ -27,6 +27,7 @@
it { should have_run 'rm -rf dist/*' }
it { should have_written '~/.pypirc', pypirc }
it { should have_run_in_order }
it { should_not have_run /upload_docs/ }
end

describe 'given --server other' do
Expand All @@ -38,10 +39,6 @@
it { should have_run 'python setup.py other' }
end

describe 'given --skip_existing' do
it { should have_run 'twine upload --skip-existing -r pypi dist/*' }
end

describe 'given --upload_docs' do
it { should have_run 'python setup.py upload_docs --upload-dir build/docs -r https://upload.pypi.org/legacy/' }
end
Expand All @@ -54,6 +51,10 @@
it { should_not have_run 'twine check dist/*' }
end

describe 'given --no_remove_build_dir' do
it { should_not have_run 'rm -rf dist/*' }
end

describe 'given --setuptools_version 1.0.0' do
it { should have_run %r(pip install .* setuptools==1.0.0) }
end
Expand Down

0 comments on commit a992608

Please sign in to comment.