Permalink
Browse files

Merge pull request #548 from pivotal/python

Create jasmine-core python egg
  • Loading branch information...
2 parents fc173e9 + 3e739e4 commit 9e927af56e4cee5804b40c8dae69e2ce1405d9cf @infews infews committed Mar 11, 2014
Showing with 130 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +4 −0 MANIFEST.in
  3. +13 −0 RELEASE.md
  4. 0 images/__init__.py
  5. +1 −0 lib/jasmine-core/__init__.py
  6. +60 −0 lib/jasmine-core/core.py
  7. +1 −0 requirements.txt
  8. +47 −0 setup.py
View
4 .gitignore
@@ -15,6 +15,10 @@ pkg/*
.sass-cache/*
src/html/.sass-cache/*
node_modules/
+*.pyc
sauce_connect.log
*.swp
+build/
+*.egg-info/
+dist/*.tar.gz
nbproject/
View
4 MANIFEST.in
@@ -0,0 +1,4 @@
+recursive-include . *.py
+include lib/jasmine-core/*.js
+include lib/jasmine-core/*.css
+include images/*.png
View
13 RELEASE.md
@@ -36,13 +36,26 @@ When ready to release - specs are all green and the stories are done:
1. Update the release notes in `release_notes` - use the Anchorman gem to generate the markdown file and edit accordingly
1. Update the version in `package.json` to a release candidate
1. Update any links or top-level landing page for the Github Pages
+
+### Build standalone distribution
+
1. Build the standalone distribution with `grunt buildStandaloneDist`
1. Make sure you add the new ZIP file to git
+
+### Release the Python egg
+
+1. `python setup.py register sdist upload` You will need pypi credentials to upload the egg.
+
+### Release the Ruby gem
+
1. Copy version to the Ruby gem with `grunt build:copyVersionToGem`
1. __NOTE__: You will likely need to point to a local jasmine gem in order to run tests locally. _Do not_ push this version of the Gemfile.
1. __NOTE__: You will likely need to push a new jasmine gem with a dependent version right after this release.
1. Push these changes to GitHub and verify that this SHA is green
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
+
+### Finally
+
1. Visit the [Releases page for Jasmine](https://github.com/pivotal/jasmine/releases), find the tag just pushed. Paste in a link to the correct release notes for this release. The link should reference the blob and tag correctly, and the markdown file for the notes. If it is a pre-release, mark it as such.
View
0 images/__init__.py
No changes.
View
1 lib/jasmine-core/__init__.py
@@ -0,0 +1 @@
+from .core import Core
View
60 lib/jasmine-core/core.py
@@ -0,0 +1,60 @@
+import pkg_resources
+
+try:
+ from collections import OrderedDict
+except ImportError:
+ from ordereddict import OrderedDict
+
+class Core(object):
+ @classmethod
+ def js_package(cls):
+ return __package__
+
+ @classmethod
+ def css_package(cls):
+ return __package__
+
+ @classmethod
+ def image_package(cls):
+ return __package__ + ".images"
+
+ @classmethod
+ def js_files(cls):
+ js_files = sorted(list(filter(lambda x: '.js' in x, pkg_resources.resource_listdir(cls.js_package(), '.'))))
+
+ # jasmine.js needs to be first
+ js_files.insert(0, 'jasmine.js')
+
+ # boot needs to be last
+ js_files.remove('boot.js')
+ js_files.append('boot.js')
+
+ return cls._uniq(js_files)
+
+ @classmethod
+ def css_files(cls):
+ return cls._uniq(sorted(filter(lambda x: '.css' in x, pkg_resources.resource_listdir(cls.css_package(), '.'))))
+
+ @classmethod
+ def favicon(cls):
+ return 'jasmine_favicon.png'
+
+ @classmethod
+ def _uniq(self, items, idfun=None):
+ # order preserving
+
+ if idfun is None:
+ def idfun(x): return x
+ seen = {}
+ result = []
+ for item in items:
+ marker = idfun(item)
+ # in old Python versions:
+ # if seen.has_key(marker)
+ # but in new ones:
+ if marker in seen:
+ continue
+
+ seen[marker] = 1
+ result.append(item)
+ return result
View
1 requirements.txt
@@ -0,0 +1 @@
+ordereddict==1.1
View
47 setup.py
@@ -0,0 +1,47 @@
+from setuptools import setup, find_packages, os
+import json
+
+with open('package.json') as packageFile:
+ version = json.load(packageFile)['version']
+
+setup(
+ name="jasmine-core",
+ version=version,
+ url="http://pivotal.github.io/jasmine/",
+ author="Pivotal Labs",
+ author_email="jasmine-js@googlegroups.com",
+ description=('Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on '+
+ 'browsers, DOM, or any JavaScript framework. Thus it\'s suited for websites, '+
+ 'Node.js (http://nodejs.org) projects, or anywhere that JavaScript can run.'),
+ license='MIT',
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Environment :: Web Environment',
+ 'Framework :: Django',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Topic :: Software Development :: Build Tools',
+ 'Topic :: Software Development :: Quality Assurance',
+ 'Topic :: Software Development :: Testing',
+ ],
+
+ packages=['jasmine_core', 'jasmine_core.images'],
+ package_dir={'jasmine_core': 'lib/jasmine-core', 'jasmine_core.images': 'images'},
+ package_data={'jasmine_core': ['*.js', '*.css'], 'jasmine_core.images': ['*.png']},
+
+ include_package_data=True,
+
+ install_requires=['glob2>=0.4.1', 'ordereddict==1.1']
+)

0 comments on commit 9e927af

Please sign in to comment.