Repository navigation
Workflows to produce binaries #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
608ec83
0afe5ad
a357837
c62de3f
2445d81
6f65307
fcafd3d
18fec3c
ba2671a
a2f1efb
701108b
0ee36d9
eadf106
12733a0
c046824
001d529
e1fe454
a7da841
c6a5567
4e863a9
0a2c972
1ec80e6
1473d30
e48b283
64ed8c0
a3b83fc
08ed3b3
38bb1d8
1e99d25
45f37bb
d923ef8
816bb6b
ceb0842
8d36948
5b6d9c8
2896a25
8c6415e
48846b8
545eb02
fe313ae
d01f100
77dce9e
4de3ffd
c44eda1
a481adc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Build and upload wheels | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '*' | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [windows-2019, ubuntu-18.04, macos-10.15] | ||
| python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install wheel setuptools | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Build wheel | ||
| run: python setup.py bdist_wheel | ||
|
|
||
| - name: Install software | ||
| run: pip install --find-links=${{github.workspace}}/dist/ SimpleCRF | ||
|
|
||
| - name: Test import | ||
| run: python -c "import denseCRF, maxflow" | ||
|
|
||
| - name: Install deps for demos | ||
| run: pip install SimpleITK pillow matplotlib | ||
|
|
||
| - name: Test maxflow demo | ||
| run: cd ${{github.workspace}}/examples && python demo_maxflow.py 0 | ||
|
|
||
| - name: Test denseCRF demo | ||
| run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 | ||
|
|
||
| - name: Test denseCRF 3D demo | ||
| run: cd ${{github.workspace}}/examples && python demo_densecrf.py 1 | ||
|
|
||
| - name: Upload Python wheel | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: Python wheel | ||
| path: ${{github.workspace}}/dist/SimpleCRF-*.whl | ||
| if-no-files-found: error |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,8 @@ def finalize_options(self): | |
| 'maxflow_python/util.cpp', | ||
| 'dependency/maxflow-v3.0/graph.cpp', | ||
| 'dependency/maxflow-v3.0/maxflow.cpp', | ||
| maxflow_source]) | ||
| maxflow_source], | ||
| py_limited_api=False) | ||
|
|
||
| module_name2 = 'denseCRF' | ||
| densecrf_source = "densecrf_python/wrap2D_py{0:}.cpp".format(py_version) | ||
|
|
@@ -45,7 +46,8 @@ def finalize_options(self): | |
| './dependency/densecrf/src/util.cpp', | ||
| './dependency/densecrf/external/liblbfgs/lib/lbfgs.c', | ||
| densecrf_source, | ||
| ]) | ||
| ], | ||
| py_limited_api=False) | ||
|
|
||
| module_name3 = 'denseCRF3D' | ||
| densecrf_source = "densecrf_python/wrap3D_py{0:}.cpp".format(py_version) | ||
|
|
@@ -65,13 +67,14 @@ def finalize_options(self): | |
| './dependency/densecrf3d/src/util.cpp', | ||
| './dependency/densecrf/external/liblbfgs/lib/lbfgs.c', | ||
| densecrf_source, | ||
| ]) | ||
| ], | ||
| py_limited_api=False) | ||
|
|
||
| # Get the summary | ||
| description = 'An open-source toolkit for conditional random field (CRF) and dense CRF' | ||
|
|
||
| # Get the long description | ||
| if(sys.version[0] == '2'): | ||
| if (sys.version[0] == '2'): | ||
| import io | ||
| with io.open('README.md', 'r', encoding='utf-8') as f: | ||
| long_description = f.read() | ||
|
|
@@ -92,13 +95,16 @@ def finalize_options(self): | |
| ext_modules = [module1, module2, module3], | ||
| classifiers=[ | ||
| 'License :: OSI Approved :: BSD License', | ||
| 'Programming Language :: Python', | ||
| 'Programming Language :: Python :: 2', | ||
| 'Programming Language :: Python :: 3', | ||
| 'Programming Language :: Python :: 3 :: Only', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know Python 2 is deprecated, but unsure if anyone is using it still. I hope it is safe to remove python 2 from build here for this version.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there are numerous dependencies here which do not support Python 2. Today, most libraries only support Python >= 3.6. Python 2 is also no longer developed or maintained, so I would certaintly remove support for it in 2022. However, there might be some that still use older versions of Python 3. Up to you and the SimpleCRF team if this is something you want. |
||
| 'Programming Language :: Python :: 3.6', | ||
| 'Programming Language :: Python :: 3.7', | ||
| 'Programming Language :: Python :: 3.8', | ||
| 'Programming Language :: Python :: 3.9', | ||
| 'Programming Language :: Python :: 3.10', | ||
| ], | ||
| python_requires = '>=3.6', | ||
| cmdclass={'build_ext': build_ext},) | ||
|
|
||
|
|
||
| # to build, run python stup.py build or python setup.py build_ext --inplace | ||
| # to build, run python setup.py build or python setup.py build_ext --inplace | ||
| # to install, run python setup.py install | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you increase the version to the next version, say 0.2.1.2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it is necessary to make a new patch release, as no real changes to the library itself were made. The binaries should be identical to if you were to install this yourself (or at least that was the goal). If you want to make a new patch release, I gues you can do so, if you'd like, but I don't see it is as a necessity for this PR. But up to you :]