-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (39 loc) · 1.16 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
40
41
42
43
44
45
desc "Default task => :install"
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
desc "Run test"
task :test do
system "python tests/test_package.py"
end