From 1c4d34e0731645b422195993d436d52aec88d5f1 Mon Sep 17 00:00:00 2001 From: StrikerRUS Date: Tue, 9 Oct 2018 16:22:40 +0300 Subject: [PATCH 1/2] fixed Travis, converted README and version as file --- .travis.yml | 2 +- README.md | 93 ------------------------ README.rst | 133 ++++++++++++++++++++++++++++++++++ VERSION.txt | 1 + fix_README.py | 10 --- register.py | 9 --- setup.py | 17 +++-- test/test_repository_files.py | 6 +- 8 files changed, 146 insertions(+), 125 deletions(-) delete mode 100644 README.md create mode 100644 README.rst create mode 100644 VERSION.txt delete mode 100644 fix_README.py delete mode 100644 register.py diff --git a/.travis.yml b/.travis.yml index 399f80b..9e32f76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ install: - pip install codecov script: - python -m unittest discover -- coverage run --source=test +# - coverage run --source=test notifications: hipchat: rooms: diff --git a/README.md b/README.md deleted file mode 100644 index 06eca91..0000000 --- a/README.md +++ /dev/null @@ -1,93 +0,0 @@ -![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) - -[![BuildStatus](https://travis-ci.org/sendgrid/open-source-library-data-collector.svg?branch=master)](https://travis-ci.org/sendgrid/open-source-library-data-collector) -[![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python) -[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) -[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/open-source-library-data-collector.svg)](https://github.com/sendgrid/open-source-library-data-collector/graphs/contributors) -[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt) - -**Quickly and easily store data about your open source projects on GitHub and various Package Managers.** - -# Announcements - -All updates to this project are documented in our [CHANGELOG](https://github.com/sendgrid/open-source-library-data-collector/blob/master/CHANGELOG.md). - -# Table of Contents -- [Installation](#installation) -- [Heroku Deploy](#heroku-deploy) -- [Roadmap](#roadmap) -- [How to Contribute](#contribute) -- [About](#about) -- [License](#license) - - -# Installation - -## Environment Variables - -First, get your free SendGrid account [here](https://sendgrid.com/free?source=open-source-data-collector). - -Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys). - -## Initial Setup - -[Library Usage Documentation](USAGE.md) - -If you enabled CSV exports in your `config.yml`, those files will appear under the `csv/` directory in the project repository. - -## Dependencies - -- The SendGrid Service, starting at the [free level](https://sendgrid.com/free?source=open-source-data-collector) -- [virtualenv](https://pypi.python.org/pypi/virtualenv) -- [mysql](https://www.mysql.com) - - -# Heroku Deploy - -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) - -``` -heroku login -heroku create -heroku addons:create cleardb:ignite -``` -Access the cleardb DB and create the tables in db/data_schema.sql -``` -heroku config:add ENV=prod -heroku config:add GITHUB_TOKEN=<> -heroku config:add SENDGRID_API_KEY=<> -heroku addons:create scheduler:standard -``` -Configure the scheduler add-on in your Heroku dashboard to run `python app.py` at your desired frequency. - -Test by running `heroku run worker` - - -# Roadmap - -If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/open-source-library-data-collector/milestones). We would love to hear your feedback. - - -# How to Contribute - -We encourage contribution to our projects, please see our [CONTRIBUTING](https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md) guide for details. - -Quick links: - -- [Feature Request](https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#feature_request) -- [Bug Reports](https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#submit_a_bug_report) -- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#cla) -- [Improvements to the Codebase](https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#improvements_to_the_codebase) -- [License](#license) - - -# About - -open-source-library-data-collector is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). - -open-source-library-data-collector is maintained and funded by SendGrid, Inc. The names and logos for open-source-library-data-collector are trademarks of SendGrid, Inc. - - -# License - -[The MIT License (MIT)](LICENSE.txt) diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..52cf352 --- /dev/null +++ b/README.rst @@ -0,0 +1,133 @@ +.. image:: https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png + :target: https://www.sendgrid.com + :alt: SendGrid Logo + +|Build Status| |Email Notifications Badge| |Twitter Follow| |Python Versions| |PyPI Version| |GitHub contributors| |MIT licensed| + +**Quickly and easily store data about your open source projects on GitHub and various Package Managers.** + +Announcements +============= + +All updates to this project are documented in our `CHANGELOG`_. + +Table of Contents +================= + +- `Installation <#installation>`__ +- `Heroku Deploy <#heroku-deploy>`__ +- `Roadmap <#roadmap>`__ +- `How to Contribute <#how-to-contribute>`__ +- `About <#about>`__ +- `License <#license>`__ + +Installation +============ + +Environment Variables +--------------------- + +First, get your free SendGrid account `here`_. + +Next, update your environment with your `SENDGRID_API_KEY`_. + +Initial Setup +------------- + +`Library Usage Documentation`_ + +If you enabled CSV exports in your ``config.yml``, those files will appear under the ``csv/`` directory in the project repository. + +Dependencies +------------ + +- The SendGrid Service, starting at the `free level`_ +- `virtualenv`_ +- `mysql`_ + +Heroku Deploy +============= + +.. image:: https://www.herokucdn.com/deploy/button.svg + :target: https://heroku.com/deploy + +.. code:: bash + + heroku login + heroku create + heroku addons:create cleardb:ignite + +Access the cleardb DB and create the tables in ``db/data_schema.sql`` + +.. code:: bash + + heroku config:add ENV=prod + heroku config:add GITHUB_TOKEN=<> + heroku config:add SENDGRID_API_KEY=<> + heroku addons:create scheduler:standard + +Configure the scheduler add-on in your Heroku dashboard to run ``python app.py`` at your desired frequency. + +Test by running ``heroku run worker`` + +Roadmap +======= + +If you are interested in the future direction of this project, please take a look at our `milestones`_. +We would love to hear your feedback. + +How to Contribute +================= + +We encourage contribution to our projects, please see our `CONTRIBUTING`_ guide for details. + +Quick links: + +- `Feature Request`_ +- `Bug Reports`_ +- `Sign the CLA to Create a Pull Request`_ +- `Improvements to the Codebase`_ + +About +===== + +**open-source-library-data-collector** is guided and supported by the SendGrid `Developer Experience Team`_. + +**open-source-library-data-collector** is maintained and funded by SendGrid, Inc. +The names and logos for **open-source-library-data-collector** are trademarks of SendGrid, Inc. + +License +======= + +`The MIT License (MIT)`_ + +.. _CHANGELOG: https://github.com/sendgrid/open-source-library-data-collector/blob/master/CHANGELOG.md +.. _here: https://sendgrid.com/free?source=open-source-data-collector +.. _SENDGRID_API_KEY: https://app.sendgrid.com/settings/api_keys +.. _Library Usage Documentation: https://github.com/sendgrid/open-source-library-data-collector/blob/master/USAGE.md +.. _free level: https://sendgrid.com/free?source=open-source-data-collector +.. _virtualenv: https://pypi.org/project/virtualenv/ +.. _mysql: https://www.mysql.com +.. _milestones: https://github.com/sendgrid/open-source-library-data-collector/milestones +.. _CONTRIBUTING: https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md +.. _Feature Request: https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#feature-request +.. _Bug Reports: https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#submit-a-bug-report +.. _Sign the CLA to Create a Pull Request: https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#cla +.. _Improvements to the Codebase: https://github.com/sendgrid/open-source-library-data-collector/blob/master/CONTRIBUTING.md#improvements-to-the-codebase +.. _Developer Experience Team: mailto:dx@sendgrid.com +.. _The MIT License (MIT): https://github.com/sendgrid/open-source-library-data-collector/blob/master/LICENSE.txt + +.. |Build Status| image:: https://travis-ci.org/sendgrid/open-source-library-data-collector.svg?branch=master + :target: https://travis-ci.org/sendgrid/open-source-library-data-collector +.. |Email Notifications Badge| image:: https://dx.sendgrid.com/badge/python + :target: https://dx.sendgrid.com/newsletter/python +.. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow + :target: https://twitter.com/sendgrid +.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/open_source_library_data_collector.svg + :target: https://pypi.org/project/open_source_library_data_collector/ +.. |PyPI Version| image:: https://img.shields.io/pypi/v/open_source_library_data_collector.svg + :target: https://pypi.org/project/open_source_library_data_collector/ +.. |GitHub contributors| image:: https://img.shields.io/github/contributors/sendgrid/open-source-library-data-collector.svg + :target: https://github.com/sendgrid/open-source-library-data-collector/graphs/contributors +.. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg + :target: https://github.com/sendgrid/open-source-library-data-collector/blob/master/LICENSE.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..9084fa2 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +1.1.0 diff --git a/fix_README.py b/fix_README.py deleted file mode 100644 index 9314b16..0000000 --- a/fix_README.py +++ /dev/null @@ -1,10 +0,0 @@ -import pandoc -import os - -pandoc.core.PANDOC_PATH = '/usr/local/bin/pandoc' - -doc = pandoc.Document() -doc.markdown = open('README.md').read() -f = open('README.txt','w+') -f.write(doc.rst) -f.close() \ No newline at end of file diff --git a/register.py b/register.py deleted file mode 100644 index 46df8e3..0000000 --- a/register.py +++ /dev/null @@ -1,9 +0,0 @@ -import pandoc -import os - -pandoc.core.PANDOC_PATH = '/usr/local/bin/pandoc' -doc = pandoc.Document() -doc.markdown = open('README.md').read() -f = open('README.txt','w+') -f.write(doc.rst) -f.close() \ No newline at end of file diff --git a/setup.py b/setup.py index 803668e..f0bbe80 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,9 @@ +import io import os import sys from setuptools import setup, find_packages -long_description = 'Please see our GitHub README' -if os.path.exists('README.txt'): - long_description = open('README.txt').read() - def getRequires(): deps = ['github3.py', @@ -30,18 +27,22 @@ def getRequires(): deps.append('pymysql') return deps + +dir_path = os.path.abspath(os.path.dirname(__file__)) +readme = io.open(os.path.join(dir_path, 'README.rst'), encoding='utf-8').read() +version = io.open(os.path.join(dir_path, 'VERSION.txt'), encoding='utf-8').read().strip() -base_url = 'https://github.com/sendgrid/' setup( name='open_source_library_data_collector', - version='1.1.0', + version=version, author='Elmer Thomas', author_email='dx@sendgrid.com', - url=base_url + 'open-source-library-data-collector', + url='https://github.com/sendgrid/open-source-library-data-collector', packages=find_packages(), + include_package_data=True, license='MIT', description='Periodically capture external data relating to GitHub hosted Open Source libraries', - long_description=long_description, + long_description=readme, install_requires=getRequires(), keywords=[ 'GitHub', diff --git a/test/test_repository_files.py b/test/test_repository_files.py index 5b019e4..0948fd9 100644 --- a/test/test_repository_files.py +++ b/test/test_repository_files.py @@ -6,8 +6,6 @@ class TestRepositoryFiles(unittest.TestCase): def setUp(self): self.required_repo_files = [ - ['./Dockerfile', './docker/Dockerfile'], - ['./docker-compose.yml', './docker/docker-compose.yml'], ['./.codeclimate.yml'], ['./.env_sample'], ['./.github/ISSUE_TEMPLATE'], @@ -18,10 +16,10 @@ def setUp(self): ['./CODE_OF_CONDUCT.md'], ['./CONTRIBUTING.md'], ['./LICENSE.md', './LICENSE.txt'], - ['./README.md'], + ['./README.rst'], ['./TROUBLESHOOTING.md'], ['./USAGE.md'], - ['./USE_CASES.md'], + ['./VERSION.txt'], ] def _file_exists(self, files): From d8a40a3508d39e7af6e2b855e54f323c723d1862 Mon Sep 17 00:00:00 2001 From: StrikerRUS Date: Fri, 12 Oct 2018 01:36:55 +0300 Subject: [PATCH 2/2] fixed lint --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0ba0289..8891ea7 100644 --- a/setup.py +++ b/setup.py @@ -25,10 +25,12 @@ def getRequires(): deps.append('pymysql') return deps - + dir_path = os.path.abspath(os.path.dirname(__file__)) -readme = io.open(os.path.join(dir_path, 'README.rst'), encoding='utf-8').read() -version = io.open(os.path.join(dir_path, 'VERSION.txt'), encoding='utf-8').read().strip() +readme = io.open(os.path.join(dir_path, 'README.rst'), + encoding='utf-8').read() +version = io.open(os.path.join(dir_path, 'VERSION.txt'), + encoding='utf-8').read().strip() setup( name='open_source_library_data_collector',