Skip to content

Commit 2da2124

Browse files
committed
chore(lint): build process updates
1 parent 16de93a commit 2da2124

File tree

2 files changed

+24
-34
lines changed

2 files changed

+24
-34
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,21 @@ jobs:
9494
- name: Install dependencies with mypyc extras
9595
run: uv sync --extra mypyc --group build
9696

97-
- name: Build MyPyC wheel in separate directory
97+
- name: Set version to include mypyc suffix
9898
run: |
99-
# Create isolated build directory
100-
mkdir -p mypyc-build
101-
# Copy everything except the mypyc-build directory itself
102-
find . -maxdepth 1 -not -name mypyc-build -not -name . -exec cp -r {} mypyc-build/ \;
103-
cd mypyc-build
104-
105-
# Extract current version and modify for mypyc
106-
CURRENT_VERSION=$(grep '^version = "' pyproject.toml | head -1 | cut -d'"' -f2)
107-
echo "Building MyPyC wheel with version ${CURRENT_VERSION}+mypyc"
108-
109-
# Modify version for mypyc build
110-
sed -i '1,20s/^version = "'"$CURRENT_VERSION"'"$/version = "'"$CURRENT_VERSION"'+mypyc"/' pyproject.toml
99+
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | head -1 | cut -d'"' -f2)
100+
sed -i.bak 's/version = "'"$CURRENT_VERSION"'"/version = "'"$CURRENT_VERSION"'+mypyc"/' pyproject.toml
101+
shell: bash
111102

112-
# Build the wheel
113-
uv build --wheel
103+
- name: Set up MyPyC environment variables
104+
run: |
105+
echo "MYPYC_OPT_LEVEL=3" >> $GITHUB_ENV
106+
echo "MYPYC_DEBUG_LEVEL=0" >> $GITHUB_ENV
107+
echo "MYPYC_MULTI_FILE=1" >> $GITHUB_ENV
108+
shell: bash
114109

115-
# Move wheel back to main dist directory
116-
mv dist/*.whl ../dist/
110+
- name: Build MyPyC wheel
111+
run: uv build --wheel
117112
env:
118113
HATCH_BUILD_HOOKS_ENABLE: "1"
119114
MYPYC_OPT_LEVEL: "3"

.github/workflows/test-build.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,21 @@ jobs:
105105
- name: Install dependencies with mypyc extras
106106
run: uv sync --extra mypyc --group build
107107

108-
- name: Build MyPyC wheel in separate directory
108+
- name: Set version to include mypyc suffix
109109
run: |
110-
# Create isolated build directory
111-
mkdir -p mypyc-build
112-
# Copy everything except the mypyc-build directory itself
113-
find . -maxdepth 1 -not -name mypyc-build -not -name . -exec cp -r {} mypyc-build/ \;
114-
cd mypyc-build
115-
116-
# Extract current version and modify for mypyc
117-
CURRENT_VERSION=$(grep '^version = "' pyproject.toml | head -1 | cut -d'"' -f2)
118-
echo "Building MyPyC wheel with version ${CURRENT_VERSION}+mypyc"
119-
120-
# Modify version for mypyc build
121-
sed -i '1,20s/^version = "'"$CURRENT_VERSION"'"$/version = "'"$CURRENT_VERSION"'+mypyc"/' pyproject.toml
110+
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | head -1 | cut -d'"' -f2)
111+
sed -i.bak 's/version = "'"$CURRENT_VERSION"'"/version = "'"$CURRENT_VERSION"'+mypyc"/' pyproject.toml
112+
shell: bash
122113

123-
# Build the wheel
124-
uv build --wheel
114+
- name: Set up MyPyC environment variables
115+
run: |
116+
echo "MYPYC_OPT_LEVEL=3" >> $GITHUB_ENV
117+
echo "MYPYC_DEBUG_LEVEL=0" >> $GITHUB_ENV
118+
echo "MYPYC_MULTI_FILE=1" >> $GITHUB_ENV
119+
shell: bash
125120

126-
# Move wheel back to main dist directory
127-
mv dist/*.whl ../dist/
121+
- name: Build MyPyC wheel
122+
run: uv build --wheel
128123
env:
129124
HATCH_BUILD_HOOKS_ENABLE: "1"
130125
MYPYC_OPT_LEVEL: "3"

0 commit comments

Comments
 (0)