Created
August 11, 2016 15:57
-
-
Save ethankhall/bc9cd66c5a30954daa39dd5452d55123 to your computer and use it in GitHub Desktop.
PyGradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'python-sdist' | |
dependencies { | |
python 'pypi:Werkzeug:0.7', | |
python 'pypi:Jinja2:2.4', | |
python 'pypi:itsdangerous:0.21', | |
python 'pypi:click:2.0' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tree | |
├── build.gradle | |
├── gradlew | |
├── foo | |
│ ├── build.gradle | |
│ ├── setup.cfg | |
│ ├── setup.py | |
│ ├── src | |
│ │ └── foo | |
│ │ └── __init__.py | |
│ ├── requirements.txt | |
│ └── test | |
│ └── test_foo.py | |
├── <subproject> | |
│ └── ... | |
└── settings.gradle | |
$ ./gradlew build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment