Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add CI Build & Deployment pipeline #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
# Config file for automatic testing at travis-ci.org
# This file will be regenerated if you run travis_pypi_setup.py
sudo: false

addons:
apt:
packages:
- libgdal-dev

cache: pip
language: python
python:
- 3.5
- 3.4
- 3.3
- 2.7
- 2.6
- "3.6"
- "3.5"
- "3.4"

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install: pip install -U tox-travis
install: pip install -U tox-travis numpy wheel

# command to run tests, e.g. python setup.py test
script: tox

deploy:
provider: pypi
user: rasterfoundry
distributions: "sdist bdist_wheel"
password:
secure: kjKWOTwTm2eaa10Pp4/ll480TfFxP5Lb+/9cuxC1gZNZ1JuuJ/y11RQTXCKKP5CxQV0JQ8zs1RAeg0ODXsX4f1edC714oWQx/2dl3BMb5rLo2Pbk5AkVQ50gN/P9d6cSVQrlv6U+CClr8w9FNWTZ/yIeL6bs2AbK9dUyTGx/i7GBOfkAcyW23kY4vYcemonwiTKtql1Pez9rPcwX3Q+3hyiU9rX0psK3H9vdH+VzrFR4+R9URtXoaYBrNDkO3IBy62qBLhMUOwrTDkV2IGjZ3O0w9sGmON3KieuwmbII4P40FRx5OLUnmSYXhQTkhXQ1OU4LnU62y4QYCw0B94tbM4gKJdLapOVO4SjqdCmVqBLV84A+DqdMxhYQYgtP8dUwDmmyOr4jS3AVpZY75Vgmd4V1tpMxaAJwBKAcXOueXExg4GaoT/1cSpZcPPojWcujNnJX2AnrTDHctJiKPWpkV9a0MQyQ3szgwgetl4YVbUoiyKjTPwQyoeTG+gCI5czwPZj35mqFeO+OCkJq3vvkIJ4K1f1sHcO541AJa24v8Akdp/VXPxQOG75/kK3EXoH/BfWkyJF4QH8GA+dksTQGozv9dtpTa7zpNh7FkJ8VFjxSvMcB3LjfzggvQ5N1CZNnWDIZ8JWbwMbNNCdn/mWEfMZ0/ChXt+U5BGdQUeqnCe0=
on:
tags: true
python: "3.6"
repo: raster-foundry/pystac

10 changes: 6 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ include HISTORY.rst
include LICENSE
include README.rst

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
exclude .editorconfig requirements_dev.txt Makefile

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
graft tests
graft docs

global-exclude __pycache__
global-exclude *.py[co]
82 changes: 41 additions & 41 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any meaningful changes in this file? If not, I think that it should be left as it was.

# sys.path.insert(0, os.path.abspath('.'))

# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
Expand All @@ -36,7 +36,7 @@
# -- General configuration ---------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
Expand All @@ -49,7 +49,7 @@
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
Expand All @@ -69,42 +69,42 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# language = None

# There are two options for replacing |today|: either, you set today to
# some non-false value, then it is used:
#today = ''
# today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built
# documents.
#keep_warnings = False
# keep_warnings = False


# -- Options for HTML output -------------------------------------------
Expand All @@ -116,27 +116,27 @@
# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# html_theme_path = []

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# html_title = None

# A shorter title for the navigation bar. Default is the same as
# html_title.
#html_short_title = None
# html_short_title = None

# The name of an image file (relative to this directory) to place at the
# top of the sidebar.
#html_logo = None
# html_logo = None

# The name of an image file (within the static path) to use as favicon
# of the docs. This file should be a Windows icon file (.ico) being
# 16x16 or 32x32 pixels large.
#html_favicon = None
# html_favicon = None

# Add any paths that contain custom static files (such as style sheets)
# here, relative to this directory. They are copied after the builtin
Expand All @@ -146,46 +146,46 @@

# If not '', a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names
# to template names.
#html_additional_pages = {}
# html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True
# html_domain_indices = True

# If false, no index is generated.
#html_use_index = True
# html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False
# html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer.
# Default is True.
#html_show_sphinx = True
# html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer.
# Default is True.
#html_show_copyright = True
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages
# will contain a <link> tag referring to it. The value of this option
# must be the base URL from which the finished HTML is served.
#html_use_opensearch = ''
# html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'pystacdoc'
Expand Down Expand Up @@ -215,23 +215,23 @@

# The name of an image file (relative to this directory) to place at
# the top of the title page.
#latex_logo = None
# latex_logo = None

# For "manual" documents, if this is true, then toplevel headings
# are parts, not chapters.
#latex_use_parts = False
# latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []
# latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True
# latex_domain_indices = True


# -- Options for manual page output ------------------------------------
Expand All @@ -245,7 +245,7 @@
]

# If true, show URL addresses after external links.
#man_show_urls = False
# man_show_urls = False


# -- Options for Texinfo output ----------------------------------------
Expand All @@ -263,13 +263,13 @@
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# texinfo_no_detailmenu = False
13 changes: 8 additions & 5 deletions pystac/iserv/footprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def generate_thumbnail(prefix: str, tif_path: str) -> str:
x_size = 512
y_size = int(512 * aspect)

resample_cmd = ['gdal_translate', tif_path, resampled_tif_path, '-outsize', str(x_size), str(y_size)]
resample_cmd = ['gdal_translate', tif_path, resampled_tif_path, '-outsize',
str(x_size), str(y_size)]
warp_cmd = ['gdalwarp', '-dstnodata', '0', '-dstalpha', '-t_srs', 'epsg:3857',
resampled_tif_path, warped_tif_path]
thumbnail_cmd = ['gdal_translate', '-of', 'PNG', warped_tif_path, thumbnail_path]
Expand Down Expand Up @@ -70,10 +71,12 @@ def extract_footprint(tif_path: str) -> Polygon:
x_size = 512
y_size = int(512 * aspect)

resample_cmd = ['gdal_translate', tif_path, resampled_tif_path, '-outsize', str(x_size), str(y_size)]
warp_cmd = ['gdalwarp', '-co', 'compress=LZW', '-dstnodata', '0', '-dstalpha', '-t_srs', 'epsg:4326',
resampled_tif_path, warped_path]
polygonize_cmd = ['gdal_polygonize.py', '-b', '4', warped_path, '-f', 'GEOJSON', geojson_path]
resample_cmd = ['gdal_translate', tif_path, resampled_tif_path, '-outsize',
str(x_size), str(y_size)]
warp_cmd = ['gdalwarp', '-co', 'compress=LZW', '-dstnodata', '0', '-dstalpha',
'-t_srs', 'epsg:4326', resampled_tif_path, warped_path]
polygonize_cmd = ['gdal_polygonize.py', '-b', '4', warped_path, '-f',
'GEOJSON', geojson_path]

subprocess.check_call(resample_cmd)
subprocess.check_call(warp_cmd)
Expand Down
3 changes: 2 additions & 1 deletion pystac/iserv/iserv.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def write_product(filepath: str) -> Product:
@click.option('--relative/--absolute', default=True,
help='whether assets should be referenced with relative or absolute paths')
@click.option('--self-override-directory',
help='overrides directory when creating absolute self URL, useful when generating a remote asset catalog')
help='overrides directory when creating absolute self URL, useful when generating' +
'a remote asset catalog')
def create_feature(directory: str, prefix: str, product: str, relative: bool = True,
self_override_directory: str = None) -> Feature:
"""Creates a STAC feature of iserv data given a directory, prefix, and product
Expand Down
2 changes: 0 additions & 2 deletions pystac/models/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ def dict(self) -> dict:
links=[link.dict for link in self.links],
assets=[asset.dict for asset in self.assets]
)


2 changes: 0 additions & 2 deletions pystac/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import shutil
import tempfile

import requests


logger = logging.getLogger(__name__)

Expand Down
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

Loading