From 32bf8f0c130d19f177d0750074cc38ef9287dcd9 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sat, 13 Feb 2021 22:50:31 -0800 Subject: [PATCH 01/12] chg: pkg: add cmake module to find libdatrie (test on windows) Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- .github/workflows/vs_env.bat | 10 ---------- cmake/FindDatrie.cmake | 27 +++++++++++++++++++++++++++ src/CMakeLists.txt | 13 ++++--------- 4 files changed, 53 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/vs_env.bat create mode 100644 cmake/FindDatrie.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f21835..341ff1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.04, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] steps: @@ -36,6 +36,27 @@ jobs: python -m pip install --upgrade pip pip install tox tox-gh-actions + - name: Prepare compiler environment for Windows + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + # this is supposed to cache automatically + - name: Install vcpkg plus packages + uses: lukka/run-vcpkg@v6.0 + if: runner.os == 'Windows' + with: + vcpkgTriplet: x64-windows + vcpkgArguments: libdatrie + vcpkgGitCommitId: 066c6fd712a3b7015388de644e44faf9774f3641 + + # This points the extension builder at the vcpkg toolchain file + - name: Set Windows environment variables + if: runner.os == 'Windows' + run: | + echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV + - name: apt helper action if: runner.os == 'Linux' uses: ryankurte/action-apt@v0.2.0 diff --git a/.github/workflows/vs_env.bat b/.github/workflows/vs_env.bat deleted file mode 100644 index 81bf72f..0000000 --- a/.github/workflows/vs_env.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off - -SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" - -:: See https://github.com/microsoft/vswhere/wiki/Find-VC -for /f "usebackq delims=*" %%i in (`%VSWHERE% -latest -property installationPath`) do ( - call "%%i\VC\Auxiliary\Build\vcvarsall.bat" %* -) - -bash -c "export -p > env.sh" diff --git a/cmake/FindDatrie.cmake b/cmake/FindDatrie.cmake new file mode 100644 index 0000000..6a6f2f2 --- /dev/null +++ b/cmake/FindDatrie.cmake @@ -0,0 +1,27 @@ +# find first using DATRIE_PATH if set +# +find_path(DATRIE_INCLUDE_DIR triedefs.h + PATHS ${DATRIE_PATH} ENV DATRIE_PATH + PATH_SUFFIXES include include/datrie NO_DEFAULT_PATH) + +find_path(DATRIE_INCLUDE_DIR triedefs.h + PATH_SUFFIXES include include/datrie) + +find_library(DATRIE_LIBRARY NAMES datrie libdatrie + PATHS ${DATRIE_PATH} ENV DATRIE_PATH + PATH_SUFFIXES lib lib64 lib/datrie lib64/datrie NO_DEFAULT_PATH) + +find_library(DATRIE_LIBRARY NAMES datrie libdatrie + PATH_SUFFIXES lib lib64 lib/datrie lib64/datrie) + +set(DATRIE_LIBRARIES ${DATRIE_LIBRARY}) +set(DATRIE_INCLUDE_DIRS ${DATRIE_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Datrie + DEFAULT_MSG + DATRIE_LIBRARY + DATRIE_INCLUDE_DIR) + +mark_as_advanced(DATRIE_INCLUDE_DIR DATRIE_LIBRARY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8b044b8..fdfd4a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,11 +34,12 @@ target_compile_definitions(${cython_module} PRIVATE VERSION_INFO=${SCM_VERSION_I # here we get to jump through some hoops to find libdatrie on the manylinux # docker CI images, etc -find_package(datrie CONFIG NAMES datrie) +find_package(Datrie REQUIRED) -if(datrie_FOUND) +if(Datrie_FOUND) message(STATUS "System datrie found") - target_link_libraries(${cython_module} PRIVATE datrie) + target_include_directories(${cython_module} PUBLIC ${DATRIE_INCLUDE_DIR}) + target_link_libraries(${cython_module} PRIVATE ${DATRIE_LIBRARY}) elseif(NOT MSVC) message(STATUS "Trying PkgConfig") find_package(PkgConfig REQUIRED) @@ -53,12 +54,6 @@ elseif(NOT MSVC) link_directories("/usr/lib64" "/usr/lib") target_link_libraries(${cython_module} PRIVATE "libdatrie.so") endif() -else() - # even though we used vcpkg, we get to do the manual dance with windows - find_path(DATRIE_INCLUDE_DIRS datrie/triedefs.h) - find_library(DATRIE_LIBS NAMES datrie libdatrie) - target_include_directories(${cython_module} PUBLIC ${DATRIE_INCLUDE_DIRS}) - target_link_libraries(${cython_module} PRIVATE ${DATRIE_LIBS}) endif() if(APPLE) From 00a17b269c225b29ac2ff2a6d65dbcc249653adf Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sun, 14 Feb 2021 13:12:34 -0800 Subject: [PATCH 02/12] new: pkg: prep for local building via cmake ExternalProject Signed-off-by: Stephen L Arnold --- CMakeLists.txt | 17 ++++++++++++++++- src/CMakeLists.txt | 30 ++++++++++-------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ced2ce4..7471965 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ if(NOT CMAKE_BUILD_TYPE) endif() include(GNUInstallDirs) +include(CheckIncludeFile) +include(CheckIncludeFileCXX) +include(CheckIncludeFiles) find_package(pybind11 CONFIG) @@ -30,10 +33,22 @@ endif() find_package(Threads REQUIRED) -if (${PYTHON_IS_DEBUG}) +if(${PYTHON_IS_DEBUG}) set(PY_DEBUG ON) endif() +message(STATUS "Looking for libdatrie via PkgConfig") +find_package(PkgConfig REQUIRED) +pkg_check_modules(DATRIE datrie-0.2 REQUIRED IMPORTED_TARGET) + +if(DATRIE_FOUND) + message(STATUS "System datrie found via PkgConfig") + set(FOUND_WITH_PKGCONFIG ON) +else() + message(STATUS "System datrie not found, building locally instead") + set(FOUND_WITH_PKGCONFIG OFF) +endif() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fdfd4a8..2df8436 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,27 +32,17 @@ target_include_directories(${cython_module} PUBLIC target_compile_definitions(${cython_module} PRIVATE VERSION_INFO=${SCM_VERSION_INFO}) -# here we get to jump through some hoops to find libdatrie on the manylinux -# docker CI images, etc -find_package(Datrie REQUIRED) - -if(Datrie_FOUND) - message(STATUS "System datrie found") - target_include_directories(${cython_module} PUBLIC ${DATRIE_INCLUDE_DIR}) - target_link_libraries(${cython_module} PRIVATE ${DATRIE_LIBRARY}) -elseif(NOT MSVC) - message(STATUS "Trying PkgConfig") - find_package(PkgConfig REQUIRED) - pkg_check_modules(DATRIE datrie-0.2 REQUIRED IMPORTED_TARGET) - - if(DATRIE_FOUND) - include_directories(${DATRIE_INCLUDE_DIRS}) - target_link_libraries(${cython_module} PRIVATE PkgConfig::DATRIE) +if(FOUND_WITH_PKGCONFIG) + include_directories(${DATRIE_INCLUDE_DIRS}) + target_link_libraries(${cython_module} PRIVATE PkgConfig::DATRIE) +else() + find_package(Datrie REQUIRED) + if(Datrie_FOUND) + message(STATUS "Local datrie found") + target_include_directories(${cython_module} PUBLIC ${DATRIE_INCLUDE_DIR}) + target_link_libraries(${cython_module} PRIVATE ${DATRIE_LIBRARY}) else() - # last resort for manylinux: just try it - message(STATUS "Blindly groping instead") - link_directories("/usr/lib64" "/usr/lib") - target_link_libraries(${cython_module} PRIVATE "libdatrie.so") + message(ERROR "No libdatrie found") endif() endif() From 699294390f4f0e0df3ac72f0f98a9d959c2694d8 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sun, 14 Feb 2021 13:35:19 -0800 Subject: [PATCH 03/12] chg: dev: remove git submodule for libdatrie Signed-off-by: Stephen L Arnold --- .gitmodules | 3 --- libdatrie | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 libdatrie diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3986f13..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "libdatrie"] - path = libdatrie - url = https://github.com/tlwg/libdatrie.git diff --git a/libdatrie b/libdatrie deleted file mode 160000 index d1db08a..0000000 --- a/libdatrie +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d1db08ac1c76f54ba23d63665437473788c999f3 From 5e4532b017366f403bfef31be2e3979d0a58e832 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sun, 14 Feb 2021 23:07:14 -0800 Subject: [PATCH 04/12] chg: ci: test new Find module (no vendored lib src yet) Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 32 ++++++++++++--------------- MANIFEST.in | 12 ++++------ cmake/FindDatrie.cmake | 27 ----------------------- cmake/{ => modules}/FindCython.cmake | 0 cmake/modules/FindDatrie.cmake | 33 ++++++++++++++++++++++++++++ src/CMakeLists.txt | 19 +++++----------- 7 files changed, 58 insertions(+), 66 deletions(-) delete mode 100644 cmake/FindDatrie.cmake rename cmake/{ => modules}/FindCython.cmake (100%) create mode 100644 cmake/modules/FindDatrie.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 341ff1e..6ffe78b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,7 @@ jobs: packages: libdatrie-dev pybind11-dev ninja-build - name: Test in place + if: runner.os == 'Linux' run: | tox -e py diff --git a/CMakeLists.txt b/CMakeLists.txt index 7471965..99b57d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,31 @@ cmake_minimum_required(VERSION 3.15...3.18) -project(datrie LANGUAGES C CXX) - option(PY_DEBUG "Set if python being linked is a Py_DEBUG build" OFF) +option(libdatrie_external "build Datrie library") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Default build type: RelWithDebInfo" FORCE) endif() +project(datrie LANGUAGES C CXX) + include(GNUInstallDirs) include(CheckIncludeFile) include(CheckIncludeFileCXX) include(CheckIncludeFiles) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) + +if(NOT libdatrie_external) + find_package(Datrie) +endif() + +if(NOT Datrie_FOUND) + find_package(PkgConfig) + pkg_check_modules(DATRIE datrie-0.2 IMPORTED_TARGET) +endif() + find_package(pybind11 CONFIG) if(pybind11_FOUND) @@ -37,21 +49,5 @@ if(${PYTHON_IS_DEBUG}) set(PY_DEBUG ON) endif() -message(STATUS "Looking for libdatrie via PkgConfig") -find_package(PkgConfig REQUIRED) -pkg_check_modules(DATRIE datrie-0.2 REQUIRED IMPORTED_TARGET) - -if(DATRIE_FOUND) - message(STATUS "System datrie found via PkgConfig") - set(FOUND_WITH_PKGCONFIG ON) -else() - message(STATUS "System datrie not found, building locally instead") - set(FOUND_WITH_PKGCONFIG OFF) -endif() - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${PROJECT_SOURCE_DIR}/cmake/) - include_directories(${PROJECT_SOURCE_DIR}/src) - add_subdirectory(src) diff --git a/MANIFEST.in b/MANIFEST.in index 23ef592..4a82ba2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,13 +1,9 @@ global-include CMakeLists.txt *.cmake include README.rst CHANGES.rst COPYING -include tox.ini -include tox-bench.ini -include update_c.sh +graft src +graft tests +include tox.ini tox-bench.ini update_c.sh include bench/words100k.txt.zip -recursive-include tests *.py - -include src/datrie.pyx -include src/cdatrie.pxd -include src/stdio_ext.pxd exclude src/datrie.c +exclude src/*.html global-exclude *.py[cod] __pycache__ diff --git a/cmake/FindDatrie.cmake b/cmake/FindDatrie.cmake deleted file mode 100644 index 6a6f2f2..0000000 --- a/cmake/FindDatrie.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# find first using DATRIE_PATH if set -# -find_path(DATRIE_INCLUDE_DIR triedefs.h - PATHS ${DATRIE_PATH} ENV DATRIE_PATH - PATH_SUFFIXES include include/datrie NO_DEFAULT_PATH) - -find_path(DATRIE_INCLUDE_DIR triedefs.h - PATH_SUFFIXES include include/datrie) - -find_library(DATRIE_LIBRARY NAMES datrie libdatrie - PATHS ${DATRIE_PATH} ENV DATRIE_PATH - PATH_SUFFIXES lib lib64 lib/datrie lib64/datrie NO_DEFAULT_PATH) - -find_library(DATRIE_LIBRARY NAMES datrie libdatrie - PATH_SUFFIXES lib lib64 lib/datrie lib64/datrie) - -set(DATRIE_LIBRARIES ${DATRIE_LIBRARY}) -set(DATRIE_INCLUDE_DIRS ${DATRIE_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) - -find_package_handle_standard_args(Datrie - DEFAULT_MSG - DATRIE_LIBRARY - DATRIE_INCLUDE_DIR) - -mark_as_advanced(DATRIE_INCLUDE_DIR DATRIE_LIBRARY) diff --git a/cmake/FindCython.cmake b/cmake/modules/FindCython.cmake similarity index 100% rename from cmake/FindCython.cmake rename to cmake/modules/FindCython.cmake diff --git a/cmake/modules/FindDatrie.cmake b/cmake/modules/FindDatrie.cmake new file mode 100644 index 0000000..9006c29 --- /dev/null +++ b/cmake/modules/FindDatrie.cmake @@ -0,0 +1,33 @@ +# This module finds headers and libdatrie library. +# Results are reported in variables: +# Datrie_FOUND - True if headers and library were found +# Datrie_INCLUDE_DIRS - libdatrie include directories +# Datrie_LIBRARIES - libdatrie library to be linked + +find_path(Datrie_INCLUDE_DIR + NAMES datrie/triedefs.h + PATH_SUFFIXES include include/datrie) + +find_library(Datrie_LIBRARY + NAMES datrie libdatrie + PATH_SUFFIXES lib lib64 lib32) + +mark_as_advanced(Datrie_INCLUDE_DIR Datrie_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Datrie + REQUIRED_VARS Datrie_LIBRARY Datrie_INCLUDE_DIR) + +if(Datrie_FOUND) + # need if _FOUND guard to allow project to autobuild; can't overwrite imported target even if bad + set(Datrie_INCLUDE_DIRS ${Datrie_INCLUDE_DIR}) + set(Datrie_LIBRARIES ${Datrie_LIBRARY}) + + if(NOT TARGET Datrie::Datrie) + add_library(Datrie::Datrie INTERFACE IMPORTED) + set_target_properties(Datrie::Datrie PROPERTIES + INTERFACE_LINK_LIBRARIES "${Datrie_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${Datrie_INCLUDE_DIR}" + ) + endif() +endif(Datrie_FOUND) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2df8436..7b241ed 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,16 +1,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(cython_module datrie) find_package(Cython REQUIRED) -set(cython_module datrie) - set(datrie_include_dir "${PROJECT_SOURCE_DIR}/src") set(cython_output "${CMAKE_CURRENT_SOURCE_DIR}/${cython_module}.c") set(cython_src ${cython_module}.pyx) # Track cython sources file(GLOB cy_srcs *.pyx *.pxd) -# .pyx -> .cpp +# .pyx -> .c add_custom_command(OUTPUT ${cython_output} COMMAND ${CYTHON_EXECUTABLE} -a -2 @@ -32,18 +31,12 @@ target_include_directories(${cython_module} PUBLIC target_compile_definitions(${cython_module} PRIVATE VERSION_INFO=${SCM_VERSION_INFO}) -if(FOUND_WITH_PKGCONFIG) +if(Datrie_FOUND) include_directories(${DATRIE_INCLUDE_DIRS}) - target_link_libraries(${cython_module} PRIVATE PkgConfig::DATRIE) + target_link_libraries(${cython_module} PRIVATE Datrie::Datrie) else() - find_package(Datrie REQUIRED) - if(Datrie_FOUND) - message(STATUS "Local datrie found") - target_include_directories(${cython_module} PUBLIC ${DATRIE_INCLUDE_DIR}) - target_link_libraries(${cython_module} PRIVATE ${DATRIE_LIBRARY}) - else() - message(ERROR "No libdatrie found") - endif() + include_directories(${DATRIE_INCLUDE_DIRS}) + target_link_libraries(${cython_module} PRIVATE PkgConfig::DATRIE) endif() if(APPLE) From 4daa963c49283081fdd74824302bc2175bcd03c3 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 00:32:27 -0800 Subject: [PATCH 05/12] chg: ci: set PYTHONIOENCODING to utf-8 (4 tests fail on windows) Signed-off-by: Stephen L Arnold --- .gitattributes | 11 +++++++++++ .github/workflows/ci.yml | 1 + tox.ini | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bb3f296 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Set default behaviour to automatically normalize line endings. +* text=auto + +# Force batch scripts to always use CRLF line endings so that if a repo is +# accessed in Windows via a file share from Linux, the scripts will work. +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf + +# Force bash scripts to always use LF line endings so that if a repo is +# accessed in Unix via a file share from Windows, the scripts will work. +*.sh text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ffe78b..99a6202 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} + PYTHONIOENCODING: utf-8 PIP_DOWNLOAD_CACHE: ${{ github.workspace }}/../.pip_download_cache strategy: fail-fast: true diff --git a/tox.ini b/tox.ini index 7230669..62bd838 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,7 @@ passenv = CMAKE_BUILD_OVERRIDE CMAKE_TOOLCHAIN_FILE CMAKE_GENERATOR + PYTHONIOENCODING PIP_DOWNLOAD_CACHE setenv = @@ -45,6 +46,7 @@ passenv = CMAKE_BUILD_OVERRIDE CMAKE_TOOLCHAIN_FILE CMAKE_GENERATOR + PYTHONIOENCODING PIP_DOWNLOAD_CACHE deps = @@ -66,6 +68,7 @@ passenv = CMAKE_BUILD_OVERRIDE CMAKE_TOOLCHAIN_FILE CMAKE_GENERATOR + PYTHONIOENCODING PIP_DOWNLOAD_CACHE allowlist_externals = bash @@ -85,6 +88,8 @@ commands = skip_install = true passenv = CI + PYTHONIOENCODING + PIP_DOWNLOAD_CACHE deps = pip>=20.0.1 From a5fdc68d8ddb2b10632e57aa6a53acd5e28fb36e Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 09:27:14 -0800 Subject: [PATCH 06/12] chg: ci: set git eol and add macos Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99a6202..9289d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,15 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-20.04, macos-latest] python-version: [3.6, 3.7, 3.8, 3.9] steps: + - name: Set git crlf/eol + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - uses: actions/checkout@v2 with: fetch-depth: 0 @@ -67,7 +72,7 @@ jobs: packages: libdatrie-dev pybind11-dev ninja-build - name: Test in place - if: runner.os == 'Linux' + if: runner.os != 'Windows' run: | tox -e py From f8e855a13e8429c96d42c2914a9734777c5253b9 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 10:47:56 -0800 Subject: [PATCH 07/12] chg: pkg: respin build matrix for vcpkg on both macos and windows Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9289d40..f98f6e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,15 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-20.04, macos-latest] + os: [ubuntu-20.04, macos-latest, windows-2019] python-version: [3.6, 3.7, 3.8, 3.9] + include: + - os: windows-2019 + triplet: x64-windows + - os: ubuntu-20.04 + triplet: x64-linux + - os: macos-latest + triplet: x64-osx steps: - name: Set git crlf/eol @@ -42,6 +49,11 @@ jobs: python -m pip install --upgrade pip pip install tox tox-gh-actions + - name: Install macos deps with brew + if: runner.os == 'macOS' + run: | + brew install ninja + - name: Prepare compiler environment for Windows if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 @@ -51,15 +63,15 @@ jobs: # this is supposed to cache automatically - name: Install vcpkg plus packages uses: lukka/run-vcpkg@v6.0 - if: runner.os == 'Windows' + if: runner.os != 'Linux' with: - vcpkgTriplet: x64-windows + vcpkgTriplet: ${{ matrix.triplet }} vcpkgArguments: libdatrie vcpkgGitCommitId: 066c6fd712a3b7015388de644e44faf9774f3641 # This points the extension builder at the vcpkg toolchain file - name: Set Windows environment variables - if: runner.os == 'Windows' + if: runner.os != 'Linux' run: | echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV From 7ffd0ee01a04103a3f10d0bebe879441c378ee80 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 12:00:07 -0800 Subject: [PATCH 08/12] fix: restore missing ctypedef, add more FindDatrie search paths Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 13 +++++++------ cmake/modules/FindDatrie.cmake | 24 ++++++++++++++++++++++-- src/cdatrie.pxd | 2 ++ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f98f6e4..02988eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,12 +18,12 @@ jobs: PYTHONIOENCODING: utf-8 PIP_DOWNLOAD_CACHE: ${{ github.workspace }}/../.pip_download_cache strategy: - fail-fast: true + fail-fast: false matrix: - os: [ubuntu-20.04, macos-latest, windows-2019] + os: [ubuntu-20.04, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] include: - - os: windows-2019 + - os: windows-latest triplet: x64-windows - os: ubuntu-20.04 triplet: x64-linux @@ -62,16 +62,17 @@ jobs: # this is supposed to cache automatically - name: Install vcpkg plus packages - uses: lukka/run-vcpkg@v6.0 + uses: lukka/run-vcpkg@v6.1 if: runner.os != 'Linux' with: vcpkgTriplet: ${{ matrix.triplet }} + vcpkgDirectory: ${{ runner.workspace }}/vcpkg/ vcpkgArguments: libdatrie - vcpkgGitCommitId: 066c6fd712a3b7015388de644e44faf9774f3641 + vcpkgGitCommitId: b60f003ccf5fe8613d029f49f835c8929a66eb61 # This points the extension builder at the vcpkg toolchain file - name: Set Windows environment variables - if: runner.os != 'Linux' + if: runner.os == 'Windows' run: | echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV diff --git a/cmake/modules/FindDatrie.cmake b/cmake/modules/FindDatrie.cmake index 9006c29..23167c9 100644 --- a/cmake/modules/FindDatrie.cmake +++ b/cmake/modules/FindDatrie.cmake @@ -6,11 +6,31 @@ find_path(Datrie_INCLUDE_DIR NAMES datrie/triedefs.h - PATH_SUFFIXES include include/datrie) + HINTS + ENV VCPKG_ROOT + PATH_SUFFIXES include include/datrie + PATHS + ~/Library/Frameworks + /Library/Frameworks + /opt/local + /opt + /usr + /usr/local/ +) find_library(Datrie_LIBRARY NAMES datrie libdatrie - PATH_SUFFIXES lib lib64 lib32) + HINTS + ENV VCPKG_ROOT + PATH_SUFFIXES lib lib64 lib32 + PATHS + ~/Library/Frameworks + /Library/Frameworks + /opt/local + /opt + /usr + /usr/local/ +) mark_as_advanced(Datrie_INCLUDE_DIR Datrie_LIBRARY) diff --git a/src/cdatrie.pxd b/src/cdatrie.pxd index f752054..b527074 100644 --- a/src/cdatrie.pxd +++ b/src/cdatrie.pxd @@ -30,6 +30,8 @@ cdef extern from "datrie/trie.h": ctypedef struct TrieIterator: pass + ctypedef int TrieData + ctypedef bint (*TrieEnumFunc) (AlphaChar *key, TrieData key_data, void *user_data) From 70982e914fe474e91e30f700547bc36e26afd275 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 13:53:41 -0800 Subject: [PATCH 09/12] fix: ci: separate steps for vcpkg on macos/windows Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02988eb..2cff471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,13 +22,6 @@ jobs: matrix: os: [ubuntu-20.04, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] - include: - - os: windows-latest - triplet: x64-windows - - os: ubuntu-20.04 - triplet: x64-linux - - os: macos-latest - triplet: x64-osx steps: - name: Set git crlf/eol @@ -49,10 +42,18 @@ jobs: python -m pip install --upgrade pip pip install tox tox-gh-actions + - name: Prepare vcpkg environment for macos + if: runner.os == 'macOS' + run: | + export VCPKG_ROOT=/usr/local/share/vcpkg + echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV + - name: Install macos deps with brew if: runner.os == 'macOS' run: | brew install ninja + vcpkg update + vcpkg install libdatrie:x64-osx - name: Prepare compiler environment for Windows if: runner.os == 'Windows' @@ -71,8 +72,8 @@ jobs: vcpkgGitCommitId: b60f003ccf5fe8613d029f49f835c8929a66eb61 # This points the extension builder at the vcpkg toolchain file - - name: Set Windows environment variables - if: runner.os == 'Windows' + - name: Set vcpkg.cmake path on ${{ matrix.os }} + if: runner.os != 'Linux' run: | echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV From ad853d047ea493292393e9bb641656e0eb1d8e4a Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 19:59:33 -0800 Subject: [PATCH 10/12] fix: use fetchcontent for local srcs, revert "restore missing ctypedef" Signed-off-by: Stephen L Arnold --- CMakeLists.txt | 23 ++++++++++++++++++++--- src/CMakeLists.txt | 12 +++++++++++- src/cdatrie.pxd | 2 -- tox.ini | 1 + 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99b57d0..18e2530 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 3.15...3.18) option(PY_DEBUG "Set if python being linked is a Py_DEBUG build" OFF) -option(libdatrie_external "build Datrie library") +option(USE_LIBDATRIE_PKG "Use OS-provided libdatrie package") +if(DEFINED ENV{HAVE_LIBDATRIE_PKG}) + set(USE_LIBDATRIE_PKG "$ENV{HAVE_LIBDATRIE_PKG}") +endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING @@ -17,15 +20,29 @@ include(CheckIncludeFiles) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) -if(NOT libdatrie_external) +if(USE_LIBDATRIE_PKG) find_package(Datrie) endif() -if(NOT Datrie_FOUND) +if(USE_LIBDATRIE_PKG AND NOT Datrie_FOUND) find_package(PkgConfig) pkg_check_modules(DATRIE datrie-0.2 IMPORTED_TARGET) endif() +if(NOT USE_LIBDATRIE_PKG) + message(STATUS "Fetching libdatrie from github") + # Fetch libdatrie + include(FetchContent) + + FetchContent_Declare( + libdatrie + GIT_REPOSITORY https://github.com/tlwg/libdatrie + GIT_TAG v0.2.13 + ) + FetchContent_MakeAvailable(libdatrie) + # this gets us the package source directory +endif() + find_package(pybind11 CONFIG) if(pybind11_FOUND) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7b241ed..eeed7eb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,6 +20,16 @@ add_custom_command(OUTPUT ${cython_output} DEPENDS ${cy_srcs} COMMENT "Cythonizing extension ${cython_src}") +if(NOT USE_LIBDATRIE_PKG) + # use the locally cloned source from FetchContent + set(DATRIE_INCLUDE_DIR "${libdatrie_SOURCE_DIR}") + file(GLOB_RECURSE DATRIE_SOURCES + LIST_DIRECTORIES true + "${libdatrie_SOURCE_DIR}/datrie/*.c") + list(APPEND cython_output ${DATRIE_SOURCES}) + include_directories(${DATRIE_INCLUDE_DIR}) +endif() + add_library(${cython_module} MODULE ${cython_output}) set_target_properties(${cython_module} @@ -34,7 +44,7 @@ target_compile_definitions(${cython_module} PRIVATE VERSION_INFO=${SCM_VERSION_I if(Datrie_FOUND) include_directories(${DATRIE_INCLUDE_DIRS}) target_link_libraries(${cython_module} PRIVATE Datrie::Datrie) -else() +elseif(DATRIE_FOUND) include_directories(${DATRIE_INCLUDE_DIRS}) target_link_libraries(${cython_module} PRIVATE PkgConfig::DATRIE) endif() diff --git a/src/cdatrie.pxd b/src/cdatrie.pxd index b527074..f752054 100644 --- a/src/cdatrie.pxd +++ b/src/cdatrie.pxd @@ -30,8 +30,6 @@ cdef extern from "datrie/trie.h": ctypedef struct TrieIterator: pass - ctypedef int TrieData - ctypedef bint (*TrieEnumFunc) (AlphaChar *key, TrieData key_data, void *user_data) diff --git a/tox.ini b/tox.ini index 62bd838..e071054 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,7 @@ passenv = CMAKE_BUILD_OVERRIDE CMAKE_TOOLCHAIN_FILE CMAKE_GENERATOR + HAVE_LIBDATRIE_PKG PYTHONIOENCODING PIP_DOWNLOAD_CACHE From a13538002baf78531f8c41547c498df8f225e54e Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 20:41:59 -0800 Subject: [PATCH 11/12] fix: ci: remove vcpkg install from macos, only use lib pkg on linux Signed-off-by: Stephen L Arnold --- .github/workflows/ci.yml | 32 +++++++------------------------- tox.ini | 8 +++----- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cff471..76a4e1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,47 +37,28 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Add requirements + - name: Add pip requirements run: | python -m pip install --upgrade pip pip install tox tox-gh-actions - - name: Prepare vcpkg environment for macos - if: runner.os == 'macOS' - run: | - export VCPKG_ROOT=/usr/local/share/vcpkg - echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV - - name: Install macos deps with brew if: runner.os == 'macOS' run: | brew install ninja - vcpkg update - vcpkg install libdatrie:x64-osx - - name: Prepare compiler environment for Windows + - name: Prepare compiler environment for ${{ matrix.os }} if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 with: arch: x64 - # this is supposed to cache automatically - - name: Install vcpkg plus packages - uses: lukka/run-vcpkg@v6.1 - if: runner.os != 'Linux' - with: - vcpkgTriplet: ${{ matrix.triplet }} - vcpkgDirectory: ${{ runner.workspace }}/vcpkg/ - vcpkgArguments: libdatrie - vcpkgGitCommitId: b60f003ccf5fe8613d029f49f835c8929a66eb61 - - # This points the extension builder at the vcpkg toolchain file - - name: Set vcpkg.cmake path on ${{ matrix.os }} - if: runner.os != 'Linux' + - name: Set have package true for ${{ matrix.os }} + if: runner.os == 'Linux' run: | - echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV + echo "HAVE_LIBDATRIE_PKG=TRUE" >> $GITHUB_ENV - - name: apt helper action + - name: Install deps with apt helper action if: runner.os == 'Linux' uses: ryankurte/action-apt@v0.2.0 with: @@ -86,6 +67,7 @@ jobs: packages: libdatrie-dev pybind11-dev ninja-build - name: Test in place + # windows does not like build_ext -i or removing previous build if: runner.os != 'Windows' run: | tox -e py diff --git a/tox.ini b/tox.ini index e071054..c0e0424 100644 --- a/tox.ini +++ b/tox.ini @@ -33,9 +33,9 @@ deps = hypothesis commands = - python -c "import path; path.Path('build').rmtree_p()" python setup.py build_ext --inplace python -m pytest [] + python -c "import path; path.Path('build').rmtree_p()" [testenv:dev] skip_install = true @@ -47,6 +47,7 @@ passenv = CMAKE_BUILD_OVERRIDE CMAKE_TOOLCHAIN_FILE CMAKE_GENERATOR + HAVE_LIBDATRIE_PKG PYTHONIOENCODING PIP_DOWNLOAD_CACHE @@ -69,19 +70,16 @@ passenv = CMAKE_BUILD_OVERRIDE CMAKE_TOOLCHAIN_FILE CMAKE_GENERATOR + HAVE_LIBDATRIE_PKG PYTHONIOENCODING PIP_DOWNLOAD_CACHE -allowlist_externals = bash - deps = pip>=20.0.1 pep517 twine - path commands = - python -c "import path; path.Path('build').rmtree_p()" python -m pep517.build . twine check dist/* From 8ef0b0be4f0d965ca42a83987118d98fea9b2ff8 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Mon, 15 Feb 2021 22:58:27 -0800 Subject: [PATCH 12/12] new: ci: add more workflows for manylinux wheels Signed-off-by: Stephen L Arnold --- .github/workflows/release.yml | 143 +++++++++++++++++++++++++++++++ .github/workflows/wheel-check.sh | 17 ++++ .github/workflows/wheels.yml | 92 ++++++++++++++++++++ 3 files changed, 252 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100755 .github/workflows/wheel-check.sh create mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5892b9f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,143 @@ +name: Release + +on: + push: + # release on tag push + tags: + - '*' + +jobs: + cibw_wheels: + name: Build wheels on ${{ matrix.os }} for Python + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Prepare compiler environment for Windows + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: amd64 + + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==1.7.1 + + - name: Build wheels + env: + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest + CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest + CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* + CIBW_SKIP: "*-win32" + CIBW_BEFORE_ALL_LINUX: > + yum -y -q --enablerepo=extras install epel-release + && yum install -y ninja-build + CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}" + CIBW_BEFORE_ALL_MACOS: > + brew install pybind11 ninja + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.09 + CIBW_REPAIR_WHEEL_COMMAND_MACOS: "pip uninstall -y delocate && pip install git+https://github.com/Chia-Network/delocate.git && delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}" + CIBW_TEST_COMMAND: python -c "import datrie" + run: | + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Build sdist + run: | + pip install pep517 + python -m pep517.build -s . + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + create_release: + needs: [cibw_wheels, sdist] + runs-on: ubuntu-20.04 + + steps: + - name: Get version + id: get_version + run: | + echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + echo ${{ env.VERSION }} + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: 3.7 + + # download all artifacts to project dir + - uses: actions/download-artifact@v2 + + - name: Install gitchangelog + run: | + python -m pip install https://github.com/freepn/gitchangelog/archive/3.0.5.tar.gz + + - name: Generate changes file + run: | + export GITCHANGELOG_CONFIG_FILENAME=$(get-rcpath) + bash -c 'gitchangelog $(git tag --sort=taggerdate | tail -n2 | head -n1)..${{ env.VERSION }} > CHANGES.md' + + - name: Create draft release + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSION }} + name: Release v${{ env.VERSION }} + body_path: CHANGES.md + draft: true + prerelease: true + # uncomment below to upload wheels to github releases + files: wheels/datrie*.whl + + #upload_pypi: + #needs: [cibw_wheels, sdist] + #runs-on: ubuntu-latest + ## upload to PyPI on every tag starting with 'v' + #if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + ## alternatively, to publish when a GitHub Release is created, use the following rule: + ## if: github.event_name == 'release' && github.event.action == 'published' + #steps: + #- uses: actions/download-artifact@v2 + #with: + #name: artifact + #path: dist + + #- uses: pypa/gh-action-pypi-publish@master + #with: + #user: __token__ + #password: ${{ secrets.pypi_password }} + diff --git a/.github/workflows/wheel-check.sh b/.github/workflows/wheel-check.sh new file mode 100755 index 0000000..dfe15b1 --- /dev/null +++ b/.github/workflows/wheel-check.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +EXPECTED_WHEEL_COUNT=$1 + +if ! [ -n $EXPECTED_WHEEL_COUNT ]; then + exit 0 +fi + +WHEELS=$(find . -maxdepth 3 -name \*.whl) +if [ $(echo $WHEELS | wc -w) -ne $EXPECTED_WHEEL_COUNT ]; then + echo "Error: Expected $EXPECTED_WHEEL_COUNT wheels" + exit 1 +else + exit 0 +fi diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..fe7d296 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,92 @@ +name: Wheels + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + cibw_wheels: + name: Build wheels on ${{ matrix.os }} for Python + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Prepare compiler environment for Windows + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: amd64 + + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==1.7.1 + + - name: Build wheels + env: + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest + CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest + CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* + CIBW_SKIP: "*-win32" + CIBW_BEFORE_ALL_LINUX: > + yum -y -q --enablerepo=extras install epel-release + && yum install -y ninja-build + CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}" + CIBW_BEFORE_ALL_MACOS: > + brew install pybind11 ninja + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.09 + CIBW_REPAIR_WHEEL_COMMAND_MACOS: "pip uninstall -y delocate && pip install git+https://github.com/Chia-Network/delocate.git && delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}" + CIBW_TEST_COMMAND: python -c "import datrie" + run: | + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v2 + with: + name: wheels + path: ./wheelhouse/*.whl + + check_artifacts: + name: Check artifacts are correct + needs: [cibw_wheels] + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: wheels + + - name: Check number of downloaded artifacts + run: .github/workflows/wheel-check.sh 24 + + #upload_pypi: + #needs: [cibw_wheels, sdist] + #runs-on: ubuntu-latest + ## upload to PyPI on every tag starting with 'v' + #if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + ## alternatively, to publish when a GitHub Release is created, use the following rule: + ## if: github.event_name == 'release' && github.event.action == 'published' + #steps: + #- uses: actions/download-artifact@v2 + #with: + #name: artifact + #path: dist + + #- uses: pypa/gh-action-pypi-publish@master + #with: + #user: __token__ + #password: ${{ secrets.pypi_password }} +