Skip to content

Commit

Permalink
[semver:major] First official release without deploy to conda (#1)
Browse files Browse the repository at this point in the history
* update descriptions and urls

* add command to install miniconda

* add command to install opengl

* fix errors

* fix tests

* activate conda in .bats file

* add workflow for osx

* skip opengl test if not on linux

* call install_opengl on osx

* call macos tests in linux workflow

* correct naming

* rename install location parameter

* add command to configure conda

* change test order

* fix spell checker

* fix some tests

* add packages to configure command

* remove .condarc

* add script to build the conda recipe

* ignore SC2086

* minor

* use psyplot-feedstock for test

* Revert "use psyplot-feedstock for test"

This reverts commit 91f5d79.

* fix build output path

* minor fix for wildcard

* minor

* add command to build the docs

* use correct script

* add command to deploy docs

* add python package for deployment

* use versioneer

* add a package_dir

* minor

* add deploy-conda-recipe to console_scripts entry_points

* publish version tag

* Remove deploy_pkg.sh script (temporarilly)

* remove tag prefix
  • Loading branch information
Chilipp authored Nov 2, 2020
1 parent ca7f311 commit d2b7898
Show file tree
Hide file tree
Showing 29 changed files with 3,196 additions and 15 deletions.
20 changes: 16 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ orbs:
bats: circleci/[email protected]
shellcheck: circleci/[email protected]

executors:
macos-executor:
macos:
xcode: 12.2.0

# Pipeline Parameters
## These parameters are used internally by orb-tools. Skip to the Jobs section.
parameters:
Expand Down Expand Up @@ -44,10 +49,15 @@ workflows:
- orb-tools/pack # Pack orb source
- shellcheck/check:
dir: ./src/scripts
exclude: SC2148
exclude: SC2148,SC2086
# optional: Run BATS tests against your scripts
- bats/run:
name: linux-tests
path: ./src/tests
- bats/run:
name: macos-tests
path: ./src/tests
exec_environment: macos-executor
# If you accept building open source forks, protect your secrects behind a restricted context.
# A job containing restricted context (which holds your orb publishing credentials) may only be accessed by a user with proper permissions.
# An open source user may begin a pipeline with a PR, and once the pipeline is approved by an authorized user at this point, the pipeline will continue with the proper context permissions.
Expand All @@ -56,7 +66,8 @@ workflows:
requires:
- orb-tools/lint
- orb-tools/pack
- bats/run
- linux-tests
- macos-tests
- shellcheck/check
# Publish development version(s) of the orb.
- orb-tools/publish-dev:
Expand Down Expand Up @@ -89,9 +100,10 @@ workflows:
- orb-tools/dev-promote-prod-from-commit-subject:
orb-name: psyplot/psyplot-ci-orb
context: orb-publishing
add-pr-comment: false
add-pr-comment: true
fail-if-semver-not-indicated: true
publish-version-tag: false
publish-version-tag: true
ssh-fingerprints: 77:a2:25:de:77:ea:3e:46:97:3c:cd:f7:6c:88:42:12
requires:
- integration-test-1
filters:
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/python/psyplot_ci_orb/_version.py export-subst
141 changes: 140 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,141 @@
# orb.yml is "packed" from source, and not published directly from the repository.
orb.yml
orb.yml

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include src/python/psyplot_ci_orb/_version.py
46 changes: 46 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[metadata]
name = psyplot-ci-orb
description = CI tools for the psyplot organization
long_description = file: README.rst
url = https://github.com/psyplot/psyplot-ci-orb
author = Phiilpp S. Sommer
author_email = [email protected]
license = MIT
license_file = LICENSE
classifiers =
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Software Development :: Libraries
Topic :: Utilities

[options]
include_package_data = true
python_requires = >=3.6
package_dir =
= src/python
packages = find:
install_requires =
anaconda-client
conda-build

[options.entry_points]
console_scripts =
deploy-conda-recipe = psyplot_ci_orb:main

[versioneer]
VCS = git
style = pep440
versionfile_source = src/python/psyplot_ci_orb/_version.py
versionfile_build = psyplot_ci_orb/_version.py
tag_prefix =
parentdir_prefix = psyplot-ci-orb-

[mypy]
ignore_missing_imports = True
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from setuptools import setup
import versioneer

setup(
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
)
17 changes: 7 additions & 10 deletions src/@orb.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
version: 2.1

description: >
Sample orb description
# What will your orb allow users to accomplish?
# Descriptions should be short, simple, and informative.
Orb for managing packages within the psyplot visualization framework.
# This information will be displayed in the orb registry and is not mandatory.
display:
home_url: "https://www.website.com/docs"
source_url: "https://www.github.com/EXAMPLE_ORG/EXAMPLE_PROJECT"
This orb offers installation and automatic building of conda packages, as
well as an automated build of Sphinx documentations and an upload to Github
Pages
# If your orb requires other orbs, you can import them like this. Otherwise remove the "orbs" stanza.
# orbs:
# hello: circleci/[email protected]
display:
home_url: "https://psyplot.github.io"
source_url: "https://www.github.com/psyplot/psyplot-ci-orb"
31 changes: 31 additions & 0 deletions src/commands/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
description: "Build the docs with sphinx"
parameters:
condadir:
description: "Install location for anaconda"
type: string
default: "~/miniconda3"
conda_environment:
description: >
Path to a conda environment file to install additional packages. Must
install sphinx, too.
If this is empty (or the default file does not exist), we will assume
that everything is installed alread in the base conda environment.
type: string
default: docs/environment.yml
source:
description: Directory with the sphinx source files (i.e. with conf.py).
type: string
default: docs
build_dir:
description: Directory where to build the docs
type: string
default: docs/_build/html
steps:
- run:
environment:
CONDADIR: <<parameters.condadir>>
CONDAENV: <<parameters.conda_environment>>
SRC_DIR: <<parameters.source>>
BUILD_DIR: <<parameters.build_dir>>
name: Build documentation
command: <<include(scripts/build_docs.sh)>>
22 changes: 22 additions & 0 deletions src/commands/conda_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
description: "Build the conda recipe"
parameters:
condadir:
description: "Install location for anaconda"
type: string
default: "~/miniconda3"
recipe_dir:
description: Path to the recipe to build relative to the project directory
type: string
default: ci/conda-recipe
python_version:
description: Python version
type: string
default: "3.8"
steps:
- run:
environment:
CONDADIR: <<parameters.condadir>>
RECIPEDIR: <<parameters.recipe_dir>>
PYTHON_VERSION: <<parameters.python_version>>
name: Build recipe
command: <<include(scripts/conda_build.sh)>>
32 changes: 32 additions & 0 deletions src/commands/configure_conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
description: "Configure miniconda"
parameters:
condadir:
description: Install location for anaconda
type: string
default: "~/miniconda3"
main_channel:
description: Main channel to use with channels and for the branches
type: string
default: psyplot
default_branch:
description: Default branch channel for conda
type: string
default: master
channels:
description: Further default channels for conda
type: string
default: conda-forge
packages:
description: Extra packages to install into the base environment
type: string
default: conda-build anaconda-client conda-verify
steps:
- run:
environment:
CONDADIR: <<parameters.condadir>>
MAINCHANNEL: <<parameters.main_channel>>
DEFAULTBRANCH: <<parameters.default_branch>>
CHANNELS: <<parameters.channels>>
PACKAGES: <<parameters.packages>>
name: Configure conda
command: <<include(scripts/configure_conda.sh)>>
24 changes: 24 additions & 0 deletions src/commands/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
description: "Deploy the docs to Github Pages"
parameters:
deploy_dir:
description: "The docs to deploy"
type: string
default: "docs/_build/html"
target_branch:
description: >
The branch in the git repository to deploy to
type: string
default: gh-pages
fingerprint:
description: The ssh fingerprint used for deploying to github pages
type: string
steps:
- add_ssh_keys:
fingerprints:
- <<parameters.fingerprint>>
- run:
environment:
DEPLOY_DIR: <<parameters.deploy_dir>>
TARGET_BRANCH: <<parameters.target_branch>>
name: Deploy docs with gh-pages
command: <<include(scripts/deploy_docs.sh)>>
Loading

0 comments on commit d2b7898

Please sign in to comment.