Skip to content
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
39 changes: 12 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@

task :build do
sh "pip wheel ./"
end

# Dev commands
task :test do
sh "python setup.py test"
end

task :install do
sh "pip install *.whl"
end

task :upgrade do
sh "pip install -U *.whl"
end

task :clean do
sh "python setup.py clean"
sh "rm -rf *.whl dist *.egg-info build *egg wheelhouse"
end

task :upload do
sh "s3cmd put ddtrace-*.whl s3://pypi.datadoghq.com/"
end

task :dev do
sh "pip uninstall ddtrace"
sh "pip uninstall -y ddtrace"
sh "pip install -e ."
end

task :ci => [:clean, :test, :build]

task :release => [:ci, :upload]
task :release do
# Use mkwheelhouse to build the wheel, push it to S3 then update the repo index
# If at some point, we need only the 2 first steps:
# - python setup.py bdist_wheel
# - aws s3 cp dist/*.whl s3://pypi.datadoghq.com/#{s3_dir}/
s3_bucket = 'pypi.datadoghq.com'
s3_dir = ENV['S3_DIR']
fail "Missing environment variable S3_DIR" if !s3_dir or s3_dir.empty?

task :default => :test
sh "mkwheelhouse s3://#{s3_bucket}/#{s3_dir}/ ."
end
13 changes: 13 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ test:
- docker run -d -p 6379:6379 redis:3.2
- python2.7 setup.py test
- python3.4 setup.py test
deployment:
dev:
branch: /(master)|(develop)/
# CircleCI is configured to provide VERSION_SUFFIX=$CIRCLE_BRANCH$CIRCLE_BUILD_NUM
commands:
- pip install mkwheelhouse
- S3_DIR=apm_dev rake release
unstable:
tag: /v[0-9]+(\.[0-9]+)*/
# Nullify VERSION_SUFFIX to deploy the package with its public version
commands:
- pip install mkwheelhouse
- S3_DIR=apm_unstable VERSION_SUFFIX= rake release
2 changes: 2 additions & 0 deletions ddtrace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Datadog Tracing client"""
from .tracer import Tracer

__version__ = '0.2.0'

# a global tracer
tracer = Tracer()
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[nosetests]
verbosity=2

[bdist_wheel]
universal=1
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from ddtrace import __version__
from setuptools import setup, find_packages
import os

tests_require = [
'nose',
Expand All @@ -7,12 +9,20 @@
'elasticsearch',
'psycopg2',
'django',
'cassandra-driver'
'cassandra-driver',
]

version = __version__
# Append a suffix to the version for dev builds
if os.environ.get('VERSION_SUFFIX'):
version = '{v}+{s}'.format(
v=version,
s=os.environ.get('VERSION_SUFFIX'),
)

setup(
name='ddtrace',
version='0.1.8',
version=version,
description='Datadog tracing code',
url='https://github.com/DataDog/dd-trace-py',
author='Datadog, Inc.',
Expand Down