Commit e7bd21f7 authored by Yuanle Song's avatar Yuanle Song
Browse files

v3.0.0 switched to cmake based build

- switched to cmake based build.

  This allow me to continue optimize build process and make it
  work for all my existing python projects.

  Old Makefile is not easy to update at all.

  deb pkg now include venv instead of wheels. no bootstrap needed.

- removed some obsolete scripts in utils/
- removed upstart configs
- removed utils/choose_default_python.sh, just use python3 from PATH
- app.yaml
  - use Amazon ECR by default
  - enable livenessProbe by default
- fabfile now use de04 as default PROD_HOST
parent e7e68db8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ install:
py3: install
	rm -rf $(DEMO_PROJECT_NAME)
	lein new python $(DEMO_PROJECT_NAME)
	cd $(DEMO_PROJECT_NAME) && make test DEFAULT_PYTHON=python3
	cd $(DEMO_PROJECT_NAME) && cmake -G Ninja -S . -B _build && cmake --build _build --target check
	rm -rf $(DEMO_PROJECT_NAME)
deploy:
# Please use a https proxy when run inside GFW.
+2 −2
Original line number Diff line number Diff line
(defproject python/lein-template "2.0.3"
(defproject python/lein-template "3.0.0"
  :description "lein template for a python project"
  :url "https://gitlab.emacsos.com/sylecn/python-project-template"
  :license {:name "Apache License 2.0"
            :url "https://www.apache.org/licenses/LICENSE-2.0"
            :author "Yuanle Song"
            :email "sylecn@gmail.com"
            :year 2014
            :year 2021
            :key "apache-2.0"}
  :eval-in-leiningen true)
+8 −9
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@
                               (.getTime cal)))}
        dot-template-files ["gitignore"
                            ]
        template-files ["Makefile"
        template-files ["Makefile.old"    ; TODO remove me.
                        "CMakeLists.txt"
                        "fabfile.py"
                        "tox.ini"
                        "requirements.txt"
@@ -52,8 +53,6 @@
                        "app.yaml"
                        "README.rst"
                        "README-dev.rst"
                        "utils/versionutils.py"
                        "utils/build-deb"
                        "utils/ensure_pkg_installed"
                        "utils/install-git-hooks"
                        "utils/trigger-ci-build"
@@ -64,16 +63,12 @@
                        "conf/https.site"
                        "conf/logrotate.conf"
                        "conf/uwsgi.ini"
                        "conf/uwsgi.upstart"
                        "conf/web.upstart"
                        "conf/web.service"
                        "git-hooks/post-commit"
                        "git-hooks/post-merge"
                        "git-hooks/pre-commit"
                        ]
        plain-files ["utils/__init__.py"
                     "utils/choose_default_python.sh"
                     ]
        plain-files []
        empty-files []
        package-files ["__init__.py"
                       "logger.conf"
@@ -100,4 +95,8 @@
          (sh-output (apply shell/sh cmd))))
      ;; run git init if no .git found.
      (if (not (.exists (io/file project-dir ".git")))
        (sh-output (shell/sh "git" "init" :dir project-dir))))))
        (sh-output (shell/sh "git" "init" :dir project-dir)))
      (if (and (.exists (io/file project-dir ".git"))
               (not (.exists (io/file project-dir "cmake"))))
        (sh-output (shell/sh "git" "submodule" "add" "git@gitlab.emacsos.com:sylecn/cmake.git" :dir project-dir)))
      )))
+20 −0
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.13)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(WellsPython)
include(TAGS)

python_get_version({{python-pkg-name}} {{python-pkg-name}}_VERSION)
{{! Change mustache delimiter to <% and %> }}
{{=<% %>=}}
project(<% name %> LANGUAGES NONE VERSION "${<% python-pkg-name %>_VERSION}")
<%! Reset mustache delimiter %>
<%={{ }}=%>

python_project({{ name }}
  PYMODULES {{python-pkg-name}}
  INSIDE_GFW TRUE
  SERVER_NAME {{ name }}.emacsos.com
  DEB_DEPEND_PKGS python3-pip)

add_etags_target()
Loading