Skip to content

Commit

Permalink
Update appveyor configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mrahnis committed Mar 26, 2019
1 parent f1fd428 commit e6e07ec
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 80 deletions.
43 changes: 24 additions & 19 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
build: false

platform: x64

environment:
ANACONDA_TOKEN:
secure: iTF8kOBGKYYFOx5c0inHuvqyiTzjxM68i4bfZjgEpdmYCIhTwwtGj8NWWFf9AbFV
PROJECT_NAME: surficial
GITHUB_REPO_NAME: mrahnis/surficial

matrix:
- PYTHON_VERSION: 3.6
PYTHON_ARCH: 64
MINICONDA: C:\Miniconda36-x64

init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"
- ps: Write-Host $Env:PYTHON_VERSION
- ps: Write-Host $Env:MINICONDA
- ps: Write-Host $Env:GITHUB_REPO_NAME
- ps: Write-Host $Env:PLATFORM
- ps: Write-Host $Env:APPVEYOR_REPO_TAG
- ps: Write-Host $Env:APPVEYOR_REPO_TAG_NAME
- ps: Write-Host $Env:APPVEYOR_REPO_NAME

install:
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- '"%MINICONDA%\Scripts\activate.bat"'
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda install conda-build anaconda-client
- conda install conda-build conda-verify anaconda-client pytest
- conda config --add channels conda-forge phlya
- conda info -a
- conda config --add channels conda-forge
- conda config --add channels phlya
- conda config --add channels mrahnis
- "conda create -q -n test-environment python=%PYTHON_VERSION% fiona rasterio shapely click networkx adjusttext drapery pytest"
- activate test-environment
- conda build .
- conda install surficial --use-local

artifacts:
- path: 'conda-packages\*.tar.bz2'
build: false

test_script:
- conda build .
- conda install %PROJECT_NAME% --use-local
- pytest
- cmd: mkdir conda-packages
- cmd: 'copy /Y C:\Miniconda36-x64\conda-bld\win-64\*.tar.bz2 conda-packages || cmd /c "exit /b 0"'
- cmd: 'copy /Y C:\Miniconda36-x64\conda-bld\noarch\*.tar.bz2 conda-packages || cmd /c "exit /b 0"'

deploy_script:
- powershell ci/appveyor/deploy_to_anaconda.ps1
after_test:
- ps: Copy-Item $Env:MINICONDA\conda-bld -Destination . -Recurse

artifacts:
- path: 'conda-bld\noarch\*.tar.bz2'

on_success:
- ps: ci\appveyor\deploy_to_anaconda.ps1
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The CLI displays matplotlib plots of showing long-profile or plan view maps. It
.. image:: https://travis-ci.org/mrahnis/surficial.svg?branch=master
:target: https://travis-ci.org/mrahnis/surficial

.. image:: https://ci.appveyor.com/api/projects/status/github/mrahnis/surficial?svg=true
:target: https://ci.appveyor.com/api/projects/status/github/mrahnis/surficial?svg=true
.. image:: https://ci.appveyor.com/api/projects/status/b2989f95rg6o1hcn?svg=true
:target: https://ci.appveyor.com/project/mrahnis/surficial

.. image:: https://readthedocs.org/projects/surficial/badge/?version=latest
:target: http://surficial.readthedocs.io/en/latest/?badge=latest
Expand Down Expand Up @@ -41,8 +41,7 @@ If you are starting from scratch the first thing to do is install the Anaconda P
.. code-block:: console
$conda config --append channels conda-forge
$conda config --append channels mrahnis
$conda install surficial
$conda install drapery surficial -c mrahnis
To install from the source distribution:

Expand Down
35 changes: 20 additions & 15 deletions ci/appveyor/deploy_to_anaconda.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
if (($env:appveyor_repo_tag -eq "true") -and ($env:appveyor_repo_tag_name.StartsWith("v"))) {
write-output "Deploying to anaconda main channel..."
$channel = "main"
} else {
write-output "Deploying to anaconda dev channel..."
$channel = "dev"
$env:BUILD_STR = "dev"
}

Invoke-Expression "conda config --set anaconda_upload no"
If (($Env:APPVEYOR_REPO_TAG -eq "true") -and
($Env:APPVEYOR_REPO_NAME -eq ${Env:GITHUB_REPO_NAME})) {

$file_to_upload = (conda build --output .) | Out-String
$file_to_upload = (conda build --output .) | Out-String

write-output "Uploading $file_to_upload..."
Invoke-Expression "anaconda -t $env:ANACONDA_TOKEN upload --force --user mrahnis --channel $channel $file_to_upload"

write-output "Upload success"
If ($Env:APPVEYOR_REPO_TAG_NAME.StartsWith("v")) {
If ($Env:APPVEYOR_REPO_TAG_NAME.EndsWith("-dev")) {
$labels = "dev"
} ElseIf ($Env:APPVEYOR_REPO_TAG_NAME.EndsWith("-beta")) {
$labels = "beta"
} else {
$labels = "main"
}
} Else {
Write-Host "Tag not for deployment, skipping conda package deployment."
Return
}
Write-Host "Deploying package $file_to_upload with label $labels"
Invoke-Expression "anaconda -t $Env:ANACONDA_TOKEN upload --label $labels --force --no-progress $file_to_upload"
} Else {
Write-Host "Not tagged, skipping conda package deployment."
}
3 changes: 2 additions & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source:

build:
noarch: python
number: 1
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt
entry_points:
- surficial = surficial.cli.surficial:cli
Expand Down Expand Up @@ -38,5 +38,6 @@ test:

about:
home: https://github.com/mrahnis/surficial
description: Python library and CLI tools to support analysis of stream long-profiles
license: BSD
license_file: LICENSE.txt
86 changes: 45 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from os import path
from setuptools import setup, find_packages


Expand All @@ -11,47 +12,50 @@
with open('VERSION.txt', 'w') as fp:
fp.write(version)

current_directory = path.abspath(path.dirname(__file__))
with open(path.join(current_directory, 'README.rst'), 'r', encoding='utf-8') as f:
long_description = f.read()

setup(name='surficial',
version=version,
author='Michael Rahnis',
author_email='michael.rahnis@fandm.edu',
description='Python library and CLI tools to support analysis of stream long-profiles',
url='http://github.com/mrahnis/surficial',
license='BSD',
packages=find_packages(),
install_requires=[
'click',
'pandas',
'matplotlib',
'shapely',
'descartes',
'rasterio',
'fiona',
'networkx',
'adjusttext',
'drapery'
],
entry_points='''
[console_scripts]
surficial=surficial.cli.surficial:cli
[surficial.subcommands]
buffer=surficial.cli.buffer:buffer
network=surficial.cli.network:network
plan=surficial.cli.plan:plan
profile=surficial.cli.profile:profile
repair=surficial.cli.repair:repair
station=surficial.cli.station:station
identify=surficial.cli.identify:identify
''',
keywords='cross-section, topography, survey, plotting',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: GIS'
]
)
version=version,
author='Michael Rahnis',
author_email='mike@topomatrix.com',
description='Python library and CLI tools to support analysis of stream long-profiles',
long_description=long_description,
long_description_content_type='text/x-rst',
url='http://github.com/mrahnis/surficial',
license='BSD',
packages=find_packages(),
install_requires=[
'click',
'pandas',
'matplotlib',
'shapely',
'descartes',
'rasterio',
'fiona',
'networkx',
'adjusttext',
'drapery'
],
entry_points='''
[console_scripts]
surficial=surficial.cli.surficial:cli
[surficial.subcommands]
buffer=surficial.cli.buffer:buffer
network=surficial.cli.network:network
plan=surficial.cli.plan:plan
profile=surficial.cli.profile:profile
repair=surficial.cli.repair:repair
station=surficial.cli.station:station
identify=surficial.cli.identify:identify
''',
keywords='cross-section, topography, survey, plotting',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: GIS'
])

0 comments on commit e6e07ec

Please sign in to comment.