Skip to content

Commit

Permalink
add github support, python3, custom template, prod-mode
Browse files Browse the repository at this point in the history
* python3 compatability
* add bypass option for debugging in a local environment
* cleanup package organization a bit
* add github provider support
* allow custom jinja template
* use gevent or twisted for production mode
  • Loading branch information
cheshirekow committed Feb 9, 2019
1 parent 6684037 commit 6aba49b
Show file tree
Hide file tree
Showing 26 changed files with 1,960 additions and 392 deletions.
23 changes: 23 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[flake8]
# E111: indentation is not a multiple of four
# E118: indentation is not a multiple of four (comment)
# W503: line break before binary operator
# W504: line break after binary operator

# NOTE(josh): the following were added to pass checks for current state.
# Remove them as you clean things up.
# C901: xxx is too complex
# E121: continuation line under-indented for hanging indent
# E125: continuation line with same indent as next logical line
# E126: continuation line over-indented for hanging indent
# E129: visually indented line with same indent as next logical line
# E501: line too long
# E722: do not use bare 'except'
# F401: xxx imported but unused
# F403: from xxx import * used; unable to detect undefined names
# F821: undefined name 'unicode'
# F841: local variable '_' is assigned but never used
ignore = C901,E111,E114,E121,E125,E126,E129,E501,E722,F401,F403,F821,F841,W503,W504

exclude = .git,__pycache__
max-complexity = 10
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
# cmake builds
.build

# visual studio code
.vscode

# python packaging
*.egg-info/
dist/

# pyces build
.pyces-out

# jupyter autosaves
.ipynb_checkpoints

# bazel poop
bazel-*
10 changes: 9 additions & 1 deletion .pep8
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[pep8]
indent-size=2
max-line-length=80
ignore=E309 # Don't add an empty line after a class declaration

# E309: Don't add an empty line after a class declaration
# E125: continuation line with same indent as next logical line
# E129: visually indented line with same indent as next logical line
#
# NOTE(josh): E125 and E129 have false positives due to line-width=2. They
# match cases for which this would only be true if line-width=4
ignore=E309,E125,E129

12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dist: xenial
language: python
python:
- "2.7"
- "3.5"
- "3.6"

install:
- pip install -r requirements.txt

script:
- make lint
56 changes: 50 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,74 @@ project(cheshirekow)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

include(${CMAKE_SOURCE_DIR}/cmake/codestyle.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/ctest_helpers.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/doctools.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/pkgconfig.cmake)

find_package(Threads REQUIRED)
pkg_find(PKG eigen3
PKG fontconfig
PKG freetype2
PKG fuse
PKG gnuradio-osmosdr
PKG gnuradio-filter
PKG libcurl
PKG libglog
PKG librtlsdr
PKG libudev
PKG vulkan
PKG x11-xcb)

include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/third_party/googletest/include)
include_directories(${CMAKE_SOURCE_DIR}/third_party/re2)
include_directories(${CMAKE_SOURCE_DIR}/third_party/fmt/include)
include_directories(${CMAKE_SOURCE_DIR}/third_party/glm)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CXX_STANDARD "c++11" CACHE STRING "argument to '-std=' for C++ compiler")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${CXX_STANDARD}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")

add_custom_target(format ALL)
add_custom_target(lint ALL)
add_custom_target(doc ALL)
add_custom_target(format)
add_custom_target(lint)

add_custom_target(doc)

set(ENV{PYTHONPATH} ${CMAKE_SOURCE_DIR})
set(CTEST_ENVIRONMENT "PYTHONPATH=${CMAKE_SOURCE_DIR}")

set_property(GLOBAL PROPERTY gloal_doc_files "")

# NOTE(josh): don't add subdirectory for projects which aren't part of this
# sparse checkout
# NOTE(josh): search through the list of child directories and add any that
# actually contain a listfile. While globs are evil, this is necessary for
# sparse checkouts. We can and should correctly add dependencies for this glob
# in order to retrigger cmake.
file(GLOB children RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/*)
foreach(child ${children})
if(EXISTS ${CMAKE_SOURCE_DIR}/${child}/CMakeLists.txt)
message("Enabling subdirectory '${child}' for this checkout")
add_subdirectory(${child})
endif()
endforeach()

# NOTE(josh): some sparse checkouts don't include doxygen
if(EXISTS ${CMAKE_SOURCE_DIR}/doxy.config.in)
# configure the doxygen configuration
# NOTE(josh): maybe want to expose this for editor integration
# ~~~
# set(DOXY_WARN_FORMAT "\"$file($line) : $text \"")
# set(DOXY_WARN_FORMAT "\"$file:$line: $text \"")
# ~~~
configure_file("${PROJECT_SOURCE_DIR}/doxy.config.in"
"${PROJECT_BINARY_DIR}/doxy.config")

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doxy.stamp
COMMAND doxygen ${PROJECT_BINARY_DIR}/doxy.config
COMMAND touch ${PROJECT_BINARY_DIR}/doxy.stamp
DEPENDS ${PROJECT_BINARY_DIR}/doxy.config
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

add_custom_target(doxygen DEPENDS ${PROJECT_BINARY_DIR}/doxy.stamp)
add_dependencies(doc doxygen)
endif()
Loading

0 comments on commit 6aba49b

Please sign in to comment.