Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cornac
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arthur Batel
cornac
Commits
cbdc8f24
Unverified
Commit
cbdc8f24
authored
1 year ago
by
Tuan Truong
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add more build platforms in GitHub Actions (#612)
parent
335d4a60
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.github/workflows/python-package.yml
+46
-30
46 additions, 30 deletions
.github/workflows/python-package.yml
.github/workflows/python-publish.yml
+45
-31
45 additions, 31 deletions
.github/workflows/python-publish.yml
setup.py
+1
-0
1 addition, 0 deletions
setup.py
with
92 additions
and
61 deletions
.github/workflows/python-package.yml
+
46
−
30
View file @
cbdc8f24
...
...
@@ -16,47 +16,63 @@ jobs:
strategy
:
fail-fast
:
false
matrix
:
os
:
[
ubuntu-20.04
,
macos-latest
,
windows-latest
]
python-version
:
[
"
3.8"
,
"
3.9"
,
"
3.10"
,
"
3.11"
]
os
:
[
windows-latest
,
ubuntu-latest
,
macos-13
,
macos-14
]
# python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
versions
:
-
{
python
:
"
3.8"
,
numpy
:
1.22.4
}
-
{
python
:
"
3.9"
,
numpy
:
1.22.4
}
-
{
python
:
"
3.10"
,
numpy
:
1.22.4
}
-
{
python
:
"
3.11"
,
numpy
:
1.24.3
}
-
{
python
:
"
3.12"
,
numpy
:
1.26.4
}
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Set up Python ${{ matrix.python-version }}
uses
:
actions/setup-python@v2
-
name
:
Get number of CPU cores
uses
:
SimenB/github-actions-cpu-cores@v2
id
:
cpu-cores
-
uses
:
actions/checkout@v4
-
name
:
Setup Python ${{ matrix.versions.python }}
if
:
${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.versions.python != '3.8') && (matrix.versions.python != '3.9')) }}
uses
:
actions/setup-python@v5
id
:
pysetup
with
:
python-version
:
${{ matrix.
python-versi
on }}
python-version
:
${{ matrix.
versions.pyth
on }}
cache
:
'
pip'
-
name
:
Display Python version
run
:
python -c "import sys; print(sys.version)"
-
name
:
Upgrade pip wheel setuptools
run
:
python -m pip install wheel setuptools pip --upgrade
-
name
:
Setup Python 3.8-3.9 - macos-arm
if
:
${{ (matrix.os == 'macos-14') && ((matrix.versions.python == '3.8') || (matrix.versions.python == '3.9')) }}
run
:
|
brew update
brew install python@${{ matrix.versions.python }}
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python${{ matrix.versions.python }} get-pip.py
-
name
:
Install numpy for Python
3.8
if
:
matrix.python-version == '3.8'
run
:
python -m pip install numpy==1.20.3
-
name
:
Install numpy for Python
3.9
if
:
matrix.python-version == '3.9'
run
:
python -m pip install numpy==1.20.3
-
name
:
Create Python alias for Windows
if
:
matrix.os == 'windows-latest'
run
:
|
$newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.versions.python }}.exe")
New-Item -ItemType HardLink -Path "$newPath" -Value "${{ steps.pysetup.outputs.python-path }}"
-
name
:
Install numpy for Python
3.10
if
:
matrix.python-version == '3.10'
run
:
python -m pip install numpy==1.22.4
-
name
:
Display Python and Pip versions
run
:
|
python${{ matrix.versions.python }} -c "import sys; print(sys.version)"
pip --version
-
name
:
Install numpy for Python
3.11
if
:
matrix.python-version == '3.11'
run
:
python -m pip install numpy==1.24.3
-
name
:
Upgrade pip wheel setuptools
run
:
pip install wheel setuptools pip --upgrade
-
name
:
Install numpy ${{ matrix.versions.numpy }}
run
:
pip install numpy==${{ matrix.versions.numpy }}
-
name
:
Display numpy version
run
:
python -c "import numpy; print(numpy.__version__)"
run
:
python
${{ matrix.versions.python }}
-c "import numpy; print(numpy.__version__)"
-
name
:
Install other dependencies
run
:
|
python -m pip install scipy Cython pytest pytest-cov flake8
python -m pip install -e .[tests]
pip install scipy Cython pytest pytest-cov flake8
python${{ matrix.versions.python }} setup.py build_ext -j${{ steps.cpu-cores.outputs.count }}
pip install -e .[tests]
-
name
:
Lint with flake8
run
:
|
...
...
@@ -67,4 +83,4 @@ jobs:
-
name
:
Test with pytest
run
:
|
python -m
pytest --cov=cornac
pytest --cov=cornac
This diff is collapsed.
Click to expand it.
.github/workflows/python-publish.yml
+
45
−
31
View file @
cbdc8f24
...
...
@@ -19,48 +19,62 @@ jobs:
strategy
:
fail-fast
:
false
matrix
:
os
:
[
ubuntu-20.04
,
macos-latest
,
windows-latest
]
python-version
:
[
"
3.8"
,
"
3.9"
,
"
3.10"
,
"
3.11"
]
steps
:
-
uses
:
actions/checkout@v2
os
:
[
windows-latest
,
ubuntu-latest
,
macos-13
,
macos-14
]
versions
:
-
{
python
:
"
3.8"
,
numpy
:
1.22.4
}
-
{
python
:
"
3.9"
,
numpy
:
1.22.4
}
-
{
python
:
"
3.10"
,
numpy
:
1.22.4
}
-
{
python
:
"
3.11"
,
numpy
:
1.24.3
}
-
{
python
:
"
3.12"
,
numpy
:
1.26.4
}
-
name
:
Set up Python
uses
:
actions/setup-python@v2
steps
:
-
uses
:
actions/checkout@v4
-
name
:
Setup Python ${{ matrix.versions.python }}
if
:
${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.versions.python != '3.8') && (matrix.versions.python != '3.9')) }}
uses
:
actions/setup-python@v5
id
:
pysetup
with
:
python-version
:
${{ matrix.python-version }}
python-version
:
${{ matrix.versions.python }}
cache
:
'
pip'
-
name
:
Display Python version
run
:
python -c "import sys; print(sys.version)"
-
name
:
Install numpy for Python
3.8
if
:
matrix.python-version == '3.8'
run
:
python -m pip install numpy==1.20.3
-
name
:
Install numpy for Python
3.9
if
:
matrix.python-version == '3.9'
run
:
python -m pip install numpy==1.20.3
-
name
:
Setup Python 3.8-3.9 - macos-arm
if
:
${{ (matrix.os == 'macos-14') && ((matrix.versions.python == '3.8') || (matrix.versions.python == '3.9')) }}
run
:
|
brew update
brew install python@${{ matrix.versions.python }}
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python${{ matrix.versions.python }} get-pip.py
-
name
:
Install numpy for Python
3.10
if
:
matrix.python-version == '3.10'
run
:
python -m pip install numpy==1.22.4
-
name
:
Create Python alias for Windows
if
:
matrix.os == 'windows-latest'
run
:
|
$newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.versions.python }}.exe")
New-Item -ItemType HardLink -Path "$newPath" -Value "${{ steps.pysetup.outputs.python-path }}"
-
name
:
Install numpy for Python
3.11
if
:
matrix.python-version == '3.11'
run
:
python -m pip install numpy==1.24.3
-
name
:
Display Python and Pip versions
run
:
|
python${{ matrix.versions.python }} -c "import sys; print(sys.version)"
pip --version
-
name
:
Upgrade pip wheel setuptools
run
:
pip install wheel setuptools pip --upgrade
-
name
:
Install numpy ${{ matrix.versions.numpy }}
run
:
pip install numpy==${{ matrix.versions.numpy }}
-
name
:
Display numpy version
run
:
python -c "import numpy; print(numpy.__version__)"
run
:
python
${{ matrix.versions.python }}
-c "import numpy; print(numpy.__version__)"
-
name
:
Install other dependencies
run
:
|
python -m
pip install scipy Cython wheel
pip install scipy Cython wheel
-
name
:
Build wheels
run
:
python setup.py bdist_wheel
run
:
python
${{ matrix.versions.python }}
setup.py bdist_wheel
-
name
:
Rename Linux wheels to supported platform of PyPI
if
:
matrix.os == 'ubuntu-
20.04
'
if
:
matrix.os == 'ubuntu-
latest
'
run
:
for f in dist/*.whl; do mv "$f" "$(echo "$f" | sed s/linux/manylinux1/)"; done
-
name
:
Publish wheels to GitHub artifacts
...
...
@@ -72,9 +86,9 @@ jobs:
publish-pypi
:
needs
:
[
build-wheels
]
runs-on
:
ubuntu-
20.04
runs-on
:
ubuntu-
latest
steps
:
-
uses
:
actions/checkout@v
2
-
uses
:
actions/checkout@v
4
-
uses
:
actions/download-artifact@v2
with
:
...
...
@@ -82,7 +96,7 @@ jobs:
path
:
dist/
-
name
:
Set up Python
uses
:
actions/setup-python@v
2
uses
:
actions/setup-python@v
5
with
:
python-version
:
"
3.10"
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
0
View file @
cbdc8f24
...
...
@@ -357,6 +357,7 @@ setup(
"
Programming Language :: Python :: 3.9
"
,
"
Programming Language :: Python :: 3.10
"
,
"
Programming Language :: Python :: 3.11
"
,
"
Programming Language :: Python :: 3.12
"
,
"
License :: OSI Approved :: Apache Software License
"
,
"
Topic :: Software Development
"
,
"
Topic :: Scientific/Engineering
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment