Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengjieLi28 committed Oct 18, 2024
1 parent b139f6c commit 396b700
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 20 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build-wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
arch: [auto]
requires-python: [">=3.8,<3.10", ">=3.10,<3.12"]
requires-python: [">=3.9,<3.11", ">=3.11,<3.13"]
include:
- os: ubuntu-latest
arch: aarch64
requires-python: ">=3.8,<3.9"
- os: ubuntu-latest
arch: aarch64
requires-python: ">=3.9,<3.10"
Expand All @@ -35,18 +32,21 @@ jobs:
- os: ubuntu-latest
arch: aarch64
requires-python: ">=3.11,<3.12"
- os: ubuntu-latest
arch: aarch64
requires-python: ">=3.12,<3.13"
- os: macos-13
arch: universal2
requires-python: ">=3.8,<3.10"
requires-python: ">=3.9,<3.11"
- os: macos-13
arch: universal2
requires-python: ">=3.10,<3.12"
requires-python: ">=3.11,<3.13"
- os: macos-13
arch: arm64
requires-python: ">=3.8,<3.10"
requires-python: ">=3.9,<3.11"
- os: macos-13
arch: arm64
requires-python: ">=3.10,<3.12"
requires-python: ">=3.11,<3.13"

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-13", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
module: ["xoscar"]
exclude:
- { os: macos-13, python-version: 3.9}
- { os: macos-13, python-version: 3.10}
- { os: windows-latest, python-version: 3.9}
- { os: macos-13, python-version: 3.11}
- { os: windows-latest, python-version: 3.10}
- { os: windows-latest, python-version: 3.11}
include:
- { os: self-hosted, module: gpu, python-version: 3.11}
- { os: ubuntu-20.04, module: doc-build, python-version: 3.9}
Expand All @@ -112,6 +112,12 @@ jobs:
run: |
conda install -c conda-forge libstdcxx-ng
# Important for python >= 3.12
- name: Update pip and setuptools
if: ${{ matrix.python-version >= '3.12' }}
run: |
pip install -U pip setuptools
- name: Install dependencies
env:
MODULE: ${{ matrix.module }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ __pycache__/
# Distribution / packaging
.Python
build/
build_temp/
build_lib/
develop-eggs/
dist/
downloads/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.10.0
hooks:
- id: black
files: python/xoscar
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.11...3.21)
project(XoscarCollective)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
file(GLOB TMP_DIRS "../python/build/lib*")
file(GLOB TMP_DIRS "../python/build_lib")
foreach(TMP_DIR ${TMP_DIRS})
message(${TMP_DIR})
set(LIBRARY_OUTPUT_DIRECTORY ${TMP_DIR}/xoscar/collective)
Expand Down
2 changes: 1 addition & 1 deletion cpp/collective/rendezvous/include/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct formatter<std::error_code> {
decltype(auto) format(const std::error_code &err,
FormatContext &ctx) const {
return format_to(ctx.out(),
"({}: {} - {})",
fmt::runtime("({}: {} - {})"),
err.category(),
err.value(),
err.message());
Expand Down
1 change: 1 addition & 0 deletions cpp/collective/rendezvous/src/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License. */
#include "error.h"
#include "exception.h"
#include "fmt/chrono.h"
#include "fmt/ranges.h"

#include <system_error>
#include <utility>
Expand Down
3 changes: 2 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = [
"setuptools<64",
"setuptools<64; python_version<'3.12'",
"setuptools>=75; python_version>='3.12'",
"packaging",
"wheel",
"oldest-supported-numpy",
Expand Down
6 changes: 2 additions & 4 deletions python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ maintainer = Qin Xuye
maintainer_email = [email protected]
license = Apache License 2.0
url = http://github.com/xorbitsai/xoscar
python_requires = >=3.8
python_requires = >=3.9
classifier =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries

Expand All @@ -31,7 +31,6 @@ install_requires =
cloudpickle>=1.5.0
psutil>=5.9.0
tblib>=1.7.0
pickle5; python_version<"3.8"
uvloop>=0.14.0; sys_platform!="win32"
packaging

Expand All @@ -53,7 +52,6 @@ dev =
sphinx
pydata-sphinx-theme>=0.3.0
sphinx-intl>=0.9.9
mock>=4.0.0; python_version<"3.8"
flake8>=3.8.0
black
doc =
Expand Down
12 changes: 12 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ def __init__(self, name: str, sourcedir: str = "") -> None:


class CMakeBuild(build_ext):
def finalize_options(self):
"""
For python 3.12, the build_temp and build_lib dirs are temp dirs which are depended on your OS,
which leads to that cannot find the copy directory during C++ compiled process.
However, for Python < 3.12, these two dirs can be automatically located in the `build` directory of the project directory.
Therefore, in order to be compatible with all Python versions,
directly using fixed dirs here.
"""
self.build_temp = "build_temp"
self.build_lib = "build_lib"
super().finalize_options()

def copy_extensions_to_source(self):
build_py = self.get_finalized_command('build_py')
for ext in self.extensions:
Expand Down
2 changes: 1 addition & 1 deletion third_party/fmt
Submodule fmt updated 190 files

0 comments on commit 396b700

Please sign in to comment.