diff --git a/.github/workflows/build_and_upolad.yaml b/.github/workflows/build_and_upolad.yaml index 08cdb224..61805597 100644 --- a/.github/workflows/build_and_upolad.yaml +++ b/.github/workflows/build_and_upolad.yaml @@ -15,8 +15,8 @@ jobs: build_sdist: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{env.Python_Version}} @@ -24,7 +24,7 @@ jobs: run: | pip install -r requirements.txt python setup.py sdist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: artifact path: dist/*.tar.gz @@ -33,8 +33,8 @@ jobs: codecov: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{env.Python_Version}} @@ -52,8 +52,8 @@ jobs: doctest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{env.Python_Version}} @@ -80,30 +80,18 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - arch: [x86_64, AMD64, i686, arm64] - python: [36, 37, 38, 39, 310, 311] + arch: [x86_64, AMD64, arm64] + python: [38, 39, 310, 311, 312, 313] exclude: - os: ubuntu-latest arch: AMD64 - os: ubuntu-latest arch: arm64 - - - os: macos-latest - arch: AMD64 - - os: macos-latest - arch: i686 - - os: macos-latest - arch: arm64 - python: 36 - os: macos-latest - arch: arm64 - python: 37 - + arch: AMD64 - os: windows-latest arch: x86_64 - - os: windows-latest - arch: i686 - os: windows-latest arch: arm64 @@ -131,14 +119,14 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{env.Python_Version}} - name: Build wheels on ${{ matrix.CIBW_PLATFORM }} ${{matrix.arch}} - uses: pypa/cibuildwheel@v2.11.3 + uses: pypa/cibuildwheel@v2.21.3 env: CIBW_PLATFORM: ${{ matrix.CIBW_PLATFORM }} CIBW_BUILD: cp${{matrix.python}}-* @@ -155,9 +143,9 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND: ${{matrix.CIBW_REPAIR_WHEEL_COMMAND}} CIBW_BUILD_VERBOSITY: 3 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: - name: artifact + name: artifact-${{ github.sha }} path: ./wheelhouse/*.whl retention-days: 1 @@ -166,9 +154,9 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'release' steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: - name: artifact + name: artifact-${{ github.sha }} path: dist - uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -179,9 +167,9 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: - name: artifact + name: artifact-${{ github.sha }} path: dist - uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 9db55834..0cefafc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,11 @@ else() pybind11_add_module(cpp_pyqubo src/main.cpp) endif() +add_compile_definitions(BOOST_NO_CXX98_FUNCTION_BASE) + target_compile_definitions(cpp_pyqubo PRIVATE VERSION_INFO=${PYQUBO_VERSION_INFO}) target_compile_features(cpp_pyqubo PRIVATE cxx_std_17) + target_compile_options(cpp_pyqubo PRIVATE $<$: -Ofast -Wall -Wno-terminate> $<$: -Ofast -Wno-exceptions> diff --git a/README.rst b/README.rst index 7e0c9c5e..1f0c2b22 100644 --- a/README.rst +++ b/README.rst @@ -7,8 +7,8 @@ .. image:: https://readthedocs.org/projects/pyqubo/badge/?version=latest :target: http://pyqubo.readthedocs.io/en/latest/?badge=latest -.. image:: https://pepy.tech/badge/pyqubo - :target: https://pepy.tech/project/pyqubo +.. image:: https://static.pepy.tech/badge/pyqubo + :target: https://www.pepy.tech/projects/pyqubo .. image:: https://github.com/recruit-communications/pyqubo/actions/workflows/build_and_upolad.yaml/badge.svg :target: https://github.com/recruit-communications/pyqubo/actions/workflows/build_and_upolad.yaml @@ -114,7 +114,7 @@ or Supported Python Versions ------------------------- -Python 3.6, 3.7, 3.8, 3.9 and 3.10 are supported. +Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 are supported. Supported Operating Systems --------------------------- @@ -133,7 +133,7 @@ Run all tests. .. code-block:: shell export USE_TEST=1 - python -m unittest discover test + python -m unittest discover tests Show coverage report. @@ -143,12 +143,6 @@ Show coverage report. coverage run -m unittest discover coverage html -Run test with circleci CLI. - -.. code-block:: shell - - circleci build --job $JOBNAME - Run doctest. .. code-block:: shell diff --git a/external/boost_assert.cmake b/external/boost_assert.cmake index 3ea1114f..949d6b8d 100644 --- a/external/boost_assert.cmake +++ b/external/boost_assert.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( boost_assert GIT_REPOSITORY https://github.com/boostorg/assert - GIT_TAG boost-1.76.0 + GIT_TAG boost-1.82.0 ) FetchContent_GetProperties(boost_assert) diff --git a/external/pybind11.cmake b/external/pybind11.cmake index 6980ee1f..837c168b 100644 --- a/external/pybind11.cmake +++ b/external/pybind11.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG v2.10.1 + GIT_TAG v2.13.6 ) FetchContent_MakeAvailable(pybind11) diff --git a/setup.py b/setup.py index ce799ef1..9679ee98 100644 --- a/setup.py +++ b/setup.py @@ -20,15 +20,15 @@ # The name must be the _single_ output extension from the CMake build. # If you need multiple extensions, see scikit-build. class CMakeExtension(Extension): - def __init__(self, name, sourcedir=""): - Extension.__init__(self, name, sources=[]) - self.sourcedir = os.path.abspath(sourcedir) + def __init__(self, name: str, sourcedir: str = "") -> None: + super().__init__(name, sources=[]) + self.sourcedir = os.fspath(Path(sourcedir).resolve()) class CMakeBuild(build_ext): def build_extension(self, ext: CMakeExtension) -> None: # Must be in this form due to bug in .resolve() only fixed in Python 3.10+ - ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) # type: ignore[no-untyped-call] + ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) extdir = ext_fullpath.parent.resolve() # Using this requires trailing slash for auto-detection & inclusion of @@ -56,7 +56,7 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] # In this example, we pass in the version to C++. You might not need to. - cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] # type: ignore[attr-defined] + cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] if self.compiler.compiler_type != "msvc": # Using Ninja-build since it a) is available as a wheel and b) @@ -66,7 +66,7 @@ def build_extension(self, ext: CMakeExtension) -> None: # 3.15+. if not cmake_generator or cmake_generator == "Ninja": try: - import ninja # noqa: F401 + import ninja ninja_executable_path = Path(ninja.BIN_DIR) / "ninja" cmake_args += [ @@ -77,7 +77,6 @@ def build_extension(self, ext: CMakeExtension) -> None: pass else: - # Single config generators are handled "normally" single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) @@ -117,10 +116,10 @@ def build_extension(self, ext: CMakeExtension) -> None: build_temp.mkdir(parents=True) subprocess.run( - ["cmake", ext.sourcedir] + cmake_args, cwd=build_temp, check=True + ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True ) subprocess.run( - ["cmake", "--build", "."] + build_args, cwd=build_temp, check=True + ["cmake", "--build", ".", *build_args], cwd=build_temp, check=True ) @@ -157,7 +156,7 @@ def __getattribute__(self, name): 'codecov>=2.1.9' ] -python_requires = '>=3.6, <3.12' +python_requires = '>=3.8, <3.14' setup( name=package_info.__package_name__, @@ -182,11 +181,7 @@ def __getattribute__(self, name): tests_require=tests_require, include_package_data=True, classifiers=[ - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python', 'License :: OSI Approved :: Apache Software License', ] )