Skip to content

Instantly share code, notes, and snippets.

@ethankhall
Created August 11, 2016 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethankhall/a7656670aed7fc6667fab0c79dce9d5c to your computer and use it in GitHub Desktop.
Save ethankhall/a7656670aed7fc6667fab0c79dce9d5c to your computer and use it in GitHub Desktop.
Example setup.py for {py}gradle
from setuptools.dist import Distribution
import os
class GradleDistribution(Distribution, object):
"""The Python to Gradle bridge."""
#: The name of the requirements file generated by pygradle.
PINNED_TXT = 'pinned.txt'
def __init__(self, attrs):
attrs['name'] = os.getenv(self.PYGRADLE_PRODUCT_NAME)
attrs['version'] = os.getenv(self.PYGRADLE_PRODUCT_VERSION)
attrs['install_requires'] = list(self.load_requirements())
def load_requirements(self):
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment