-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
39 lines (34 loc) · 1.05 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
task :default => [:install]
desc "Remove/Delete build..."
task :clean do
rm_rf %w(build dist)
rm_rf Dir.glob("*.egg-info")
puts "Build files are removed..."
end
desc "Install package for local development purpose"
task :install => [:build] do
system "pip install -e ."
end
desc "Build package"
task :build => [:clean] do
system "python setup.py sdist bdist_wheel"
end
namespace :upload do
desc "Upload package to main distro (release)"
task :main => [:build] do
puts "Uploading package to MAIN distro..."
system "twine upload --repository pypi dist/*"
end
desc "Upload package to test distro"
task :test => [:build] do
puts "Uploading package to TEST distro..."
system "twine upload --repository testpypi dist/*"
end
end
AVAILABLE_REVISIONS = ["major", "minor", "patch"]
desc "Bump version"
task :bump, [:revision] do |t, args|
args.with_defaults(revision: "patch")
abort "Please provide valid revision: #{AVAILABLE_REVISIONS.join(',')}" unless AVAILABLE_REVISIONS.include?(args.revision)
system "bumpversion #{args.revision}"
end