Skip to content
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
93 changes: 93 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
# The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files
# Orb commands and jobs help you with common scripting around a language/tool,
# so you don't have to copy and paste it everywhere.
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
python: circleci/python@1.2

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do!
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
# You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
# The executor is the environment in which the steps below will be executed - below will use a python 3.8 container
# Change the version below to your required version of python
docker:
- image: cimg/python:3.8
environment:
SETUPTOOLS_USE_DISTUTILS: stdlib
# Checkout the code as the first step. This is a dedicated CircleCI step.
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
# Here we're making sure we use just use the system-wide pip. By default, it uses the project root's requirements.txt.
# Then run your tests!
# CircleCI will report the results back to your VCS provider.
steps:
- checkout
- restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- pip-packages-v1-{{ .Branch }}-{{ checksum "pip-freeze.txt" }}
- pip-packages-v1-{{ .Branch }}-
- pip-packages-v1-
- python/install-packages:
pkg-manager: pip-dist
pip-dependency-file: requirements.txt
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
- run:
name: Run tests
# This assumes pytest is installed via the install-package step above
command: |
make env
make test
- save_cache:
paths:
- env # this path depends on where pipenv creates a virtualenv
key: pip-packages-v1-{{ .Branch }}-{{ checksum "pip-freeze.txt" }}
build-and-publish:
docker:
- image: cimg/python:3.8
environment:
SETUPTOOLS_USE_DISTUTILS: stdlib
steps:
- checkout
- restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- pip-packages-v1-{{ .Branch }}-{{ checksum "pip-freeze.txt" }}
- pip-packages-v1-{{ .Branch }}-
- pip-packages-v1-
- python/install-packages:
pkg-manager: pip-dist
pip-dependency-file: requirements.txt
- run:
name: Publish to PyPI
command: |
bash create_pypirc.sh
make test
make release
- save_cache:
paths:
- env # this path depends on where pipenv creates a virtualenv
key: pip-packages-v1-{{ .Branch }}-{{ checksum "pip-freeze.txt" }}


# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
run-tests:
jobs:
- build-and-test
publish-to-pypi:
jobs:
- build-and-publish:
filters:
branches:
only: master
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ __pycache__/
.DS_Store
tags
.cache/
*.egg-info/
*.swp
*.sw[op]

# Exclude these directories
bin/
lib/
data/

# Distribution / packaging
Expand Down Expand Up @@ -68,3 +66,8 @@ docs/_build/

# PyBuilder
target/

# IDE and editor stuff
.idea/
.vscode/
.ropeproject/
190 changes: 0 additions & 190 deletions .ycm_extra_conf.py

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include LICENSE
include README.rst
include cpuinfo.py
include include/*.h
include src/*.cc
include src/*.cpp
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
include cpp.mk
SHELL := /usr/bin/env bash -c

MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.DEFAULT_GOAL := help
.SUFFIXES:

include python.mk
include cpp.mk

.PHONY: help
help: ## show this message and exit
@grep -E '^[a-zA-Z_0-9%-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk -F':' '{print $$(NF-1)":"$$NF}' | sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "$(BOLD)%-24s$(END) %s\n", $$1, $$2}'
Loading