This repository has been archived by the owner. It is now read-only.
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (35 sloc) 1.26 KB
import urllib
import BeautifulSoup
from contextlib import nested
from fabric.api import *
from unipath import FSPath as Path
BASE_PATH = Path(__file__).absolute().parent
def prep_sdist():
Build a sdist from the latest Evernote Python API wrappers.
landing_page = BeautifulSoup.BeautifulSoup(urllib.urlopen(API_LANDING_PAGE))
api_link = landing_page.find('a', text=API_LINK_TITLE).parent['href']
api_zip_name = Path(api_link).name
api_zip_dest = BASE_PATH.child(api_zip_name)
if not api_zip_dest.exists():
local('curl -O "%s"' % api_link)
unziped_dir = BASE_PATH.child(api_zip_name.stem)
if not unziped_dir.exists():
local('unzip %s' % api_zip_name)
local('cp -r -f %s/lib/python src' % unziped_dir)
with nested(open(''), open('', 'w')) as (fin, fout):
fout.write( % {'version': api_zip_name.stem.split('-')[-1]})
def clean():
Clean up any leftovers.
local('rm -rf dist src evernote*')
def upload():
Push a tarball to PyPI.
local('python register sdist upload')