FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #3 from KmolYuan/python · mdecourse/solvespace@68c5ff9 · GitHub

Repository navigation

Commit 68c5ff9

Browse files
authored
Merge pull request #3 from KmolYuan/python
update python branch
2 parents 2d1f1d4 + 9d57317 commit 68c5ff9

20 files changed

Lines changed: 2314 additions & 22 deletions

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
/debian/libslvs1-dev/
1414
/obj-*/
1515
/*.slvs
16+
.idea/*

‎.travis.yml‎

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
language: c
21
git:
32
submodules: false
43
jobs:
@@ -7,12 +6,14 @@ jobs:
76
name: "Debian"
87
os: linux
98
dist: bionic
9+
language: c
1010
install: ./.travis/install-debian.sh
1111
script: ./.travis/build-debian.sh
1212
- stage: deploy
1313
name: "OSX"
1414
os: osx
1515
osx_image: xcode8.3
16+
language: c
1617
install: ./.travis/install-macos.sh
1718
# the awk command is a workaround for https://github.com/travis-ci/travis-ci/issues/4704.
1819
script: ./.travis/build-macos.sh | awk '/.{0,32}/ {print $0}'
@@ -25,3 +26,68 @@ jobs:
2526
on:
2627
repo: solvespace/solvespace
2728
tags: true
29+
- &linux
30+
stage: deploy
31+
os: linux
32+
sudo: required
33+
dist: bionic
34+
language: python
35+
python: "3.6"
36+
addons:
37+
apt:
38+
update: true
39+
packages:
40+
- patchelf
41+
install: &python-install
42+
- python3 -m pip install -r cython/requirements.txt
43+
script: &python-script
44+
- cd cython && python3 setup.py test && cd -
45+
before_deploy: cd cython
46+
deploy:
47+
- provider: pypi
48+
user: $TWINE_USERNAME
49+
password: $TWINE_PASSWORD
50+
skip_cleanup: true
51+
skip_existing: true
52+
distributions: sdist
53+
on:
54+
repo: KmolYuan/solvespace
55+
tags: true
56+
- <<: *linux
57+
python: "3.7"
58+
- <<: *linux
59+
python: "3.8"
60+
- &osx
61+
stage: deploy
62+
os: osx
63+
osx_image: xcode10
64+
language: generic
65+
env: PYTHON=3.6.0
66+
before_install:
67+
- brew update
68+
- brew upgrade pyenv || true
69+
- export PATH="/Users/travis/.pyenv/shims:${PATH}"
70+
- pyenv install ${PYTHON}
71+
- pyenv global ${PYTHON}
72+
- python3 -m pip install pip -U
73+
- python3 --version
74+
- python3 -m pip --version
75+
install: *python-install
76+
script: *python-script
77+
after_success:
78+
# PyPI deployment
79+
- if [[ "$TRAVIS_REPO_SLUG" == "KmolYuan/solvespace" && -n "$TRAVIS_TAG" ]]; then
80+
python3 -m pip install twine;
81+
cd cython;
82+
python3 setup.py bdist_wheel;
83+
python3 -m twine upload dist/*.whl --skip-existing;
84+
fi
85+
- <<: *osx
86+
env: PYTHON=3.7.0
87+
- <<: *osx
88+
env: PYTHON=3.8.0
89+
before_cache:
90+
- rm -rf $HOME/.cache/pip/log
91+
cache:
92+
directories:
93+
- $HOME/.cache/pip

‎appveyor.yml‎

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,84 @@
11
version: '{build}'
22
clone_depth: 1
3-
before_build:
4-
- git submodule update --init
5-
- set tag=x%APPVEYOR_REPO_TAG_NAME%
6-
- if %tag:~,2% == xv (set BUILD_TYPE=RelWithDebInfo) else (set BUILD_TYPE=Debug)
7-
- mkdir build
8-
- cmake -G"Visual Studio 12" -Tv120 -Bbuild -H.
9-
build_script:
10-
- msbuild "build\src\solvespace.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
11-
- msbuild "build\src\solvespace-cli.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
12-
- msbuild "build\test\solvespace-testsuite.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
13-
test_script:
14-
- build\bin\%BUILD_TYPE%\solvespace-testsuite.exe
3+
environment:
4+
MSYS_DIR: C:\msys64
5+
matrix:
6+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
7+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
8+
PYTHON_DIR: C:\Python36-x64
9+
COMPILER: mingw32
10+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
11+
PYTHON_DIR: C:\Python37-x64
12+
COMPILER: mingw32
13+
# Cython not yet support
14+
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
15+
# PYTHON_DIR: C:\Python38-x64
16+
# COMPILER: mingw32
17+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
18+
PYTHON_DIR: C:\Python38-x64
19+
COMPILER: msvc
20+
for:
21+
- matrix:
22+
only:
23+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
24+
before_build:
25+
- git submodule update --init
26+
- set tag=x%APPVEYOR_REPO_TAG_NAME%
27+
- if %tag:~,2% == xv (set BUILD_TYPE=RelWithDebInfo) else (set BUILD_TYPE=Debug)
28+
- mkdir build
29+
- cmake -G"Visual Studio 12" -Tv120 -Bbuild -H.
30+
build_script:
31+
- msbuild "build\src\solvespace.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
32+
- msbuild "build\src\solvespace-cli.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
33+
- msbuild "build\test\solvespace-testsuite.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
34+
test_script:
35+
- build\bin\%BUILD_TYPE%\solvespace-testsuite.exe
36+
deploy:
37+
- provider: GitHub
38+
auth_token:
39+
secure: P9/pf2nM+jlWKe7pCjMp41HycBNP/+5AsmE/TETrDUoBOa/9WFHelqdVFrbRn9IC
40+
description: ""
41+
artifact: solvespace.exe,solvespace-cli.exe,solvespace.pdb
42+
on:
43+
APPVEYOR_REPO_NAME: solvespace/solvespace
44+
APPVEYOR_REPO_TAG: true
45+
- matrix:
46+
only:
47+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
48+
install:
49+
# Install Python-dev
50+
- IF DEFINED PYTHON_DEV choco install -y python --version %PYTHON_DEV%
51+
# Environment variables
52+
- set Path=%MSYS_DIR%\mingw64\bin;%MSYS_DIR%\usr\bin;%Path%
53+
- set Path=%PYTHON_DIR%;%PYTHON_DIR%\Scripts;%Path%
54+
# Show Python
55+
- python --version
56+
- pip --version
57+
# Upgrade setuptools
58+
- pip install setuptools -U
59+
# Set Python compiler to MinGW
60+
- cython\platform\set_pycompiler %PYTHON_DIR% %COMPILER%
61+
# Install modules
62+
- pip install -r cython\requirements.txt
63+
# Show tool kits
64+
- gcc --version
65+
- mingw32-make --version
66+
build_script:
67+
- cd cython && python setup.py test && cd ..
68+
after_build:
69+
# PyPI deployment
70+
- IF "%APPVEYOR_REPO_TAG%"=="true"
71+
IF "%APPVEYOR_REPO_NAME%"=="KmolYuan/solvespace"
72+
IF "%COMPILER%"=="mingw32" (
73+
pip install twine &&
74+
cd cython &&
75+
python setup.py bdist_wheel &&
76+
twine upload dist\*.whl --skip-existing
77+
)
1578
artifacts:
1679
- path: build\bin\%BUILD_TYPE%\solvespace.exe
1780
name: solvespace.exe
1881
- path: build\bin\%BUILD_TYPE%\solvespace-cli.exe
1982
name: solvespace-cli.exe
2083
- path: build\bin\%BUILD_TYPE%\solvespace.pdb
2184
name: solvespace.pdb
22-
deploy:
23-
- provider: GitHub
24-
auth_token:
25-
secure: P9/pf2nM+jlWKe7pCjMp41HycBNP/+5AsmE/TETrDUoBOa/9WFHelqdVFrbRn9IC
26-
description: ""
27-
artifact: solvespace.exe,solvespace-cli.exe,solvespace.pdb
28-
on:
29-
appveyor_repo_tag: true

‎cython/.gitignore‎

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/CMakeCache.txt
2+
/build*/
3+
/test/**/*.diff.*
4+
/test/**/*.curr.*
5+
*.trace
6+
/debian/tmp/
7+
/debian/*.log
8+
/debian/*.substvars
9+
/debian/*.debhelper
10+
/debian/files
11+
/debian/solvespace/
12+
/debian/libslvs1/
13+
/debian/libslvs1-dev/
14+
/obj-*/
15+
/*.slvs
16+
python_solvespace/*.cpp
17+
python_solvespace/src/
18+
python_solvespace/include/
19+
20+
# Byte-compiled / optimized / DLL files
21+
__pycache__/
22+
*.py[cod]
23+
*$py.class
24+
25+
# C extensions
26+
*.so
27+
*.o*
28+
*.cxx
29+
*.def
30+
*.lib
31+
32+
# Distribution / packaging
33+
.Python
34+
env/
35+
build/
36+
develop-eggs/
37+
dist/
38+
downloads/
39+
eggs/
40+
.eggs/
41+
lib/
42+
lib64/
43+
parts/
44+
sdist/
45+
var/
46+
wheels/
47+
*.egg-info/
48+
.installed.cfg
49+
*.egg
50+
AppImageAssistant
51+
52+
# PyInstaller
53+
# Usually these files are written by a python script from a template
54+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
55+
*.manifest
56+
*.spec
57+
58+
# Installer logs
59+
pip-log.txt
60+
pip-delete-this-directory.txt
61+
62+
# Unit test / coverage reports
63+
htmlcov/
64+
.tox/
65+
.coverage
66+
.coverage.*
67+
.cache
68+
nosetests.xml
69+
coverage.xml
70+
*.cover
71+
.hypothesis/
72+
73+
# Translations
74+
*.mo
75+
*.pot
76+
77+
# Django stuff:
78+
*.log
79+
local_settings.py
80+
81+
# Flask stuff:
82+
instance/
83+
.webassets-cache
84+
85+
# Scrapy stuff:
86+
.scrapy
87+
88+
# Sphinx documentation
89+
docs/_build/
90+
91+
# PyBuilder
92+
target/
93+
94+
# Jupyter Notebook
95+
.ipynb_checkpoints
96+
97+
# pyenv
98+
.python-version
99+
100+
# celery beat schedule file
101+
celerybeat-schedule
102+
103+
# SageMath parsed files
104+
*.sage.py
105+
106+
# dotenv
107+
.env
108+
109+
# virtualenv
110+
.venv
111+
venv/
112+
ENV/
113+
out/
114+
115+
# Spyder project settings
116+
.spyderproject
117+
.spyproject
118+
119+
# Rope project settings
120+
.ropeproject
121+
122+
# mkdocs documentation
123+
/site
124+
125+
# mypy
126+
.mypy_cache/
127+
128+
#PyCharm cache
129+
.idea/
130+
131+
# Others
132+
.DS_Store
133+
*/.DS_Store

‎cython/MANIFEST.in‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include requirements.txt
2+
include README.md
3+
recursive-include . *.h

‎cython/README.md‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[![Version](https://img.shields.io/badge/version-3.0.0-yellow.svg)](https://github.com/KmolYuan/solvespace/releases/latest)
2+
[![Build status](https://ci.appveyor.com/api/projects/status/b2o8jw7xnfqghqr5?svg=true)](https://ci.appveyor.com/project/KmolYuan/solvespace)
3+
[![Build status](https://img.shields.io/travis/KmolYuan/solvespace.svg?logo=travis)](https://travis-ci.org/KmolYuan/solvespace)
4+
[![PyPI](https://img.shields.io/pypi/v/python-solvespace.svg)](https://pypi.org/project/python-solvespace/)
5+
[![GitHub license](https://img.shields.io/badge/license-GPLv3+-blue.svg)](https://raw.githubusercontent.com/KmolYuan/solvespace/master/LICENSE)
6+
7+
# python-solvespace
8+
9+
Python library from solver of SolveSpace.
10+
11+
+ [Python API](https://pyslvs-ui.readthedocs.io/en/stable/python-solvespace-api/)
12+
+ [C API](https://github.com/solvespace/solvespace/blob/master/exposed/DOC.txt)
13+
14+
# Install
15+
16+
```bash
17+
pip install python-solvespace
18+
```
19+
20+
# Build and Test (Repository)
21+
22+
Build and install the module:
23+
24+
```bash
25+
python setup.py install
26+
```
27+
28+
Run unit test:
29+
30+
```bash
31+
python tests
32+
```
33+
34+
Uninstall the module:
35+
36+
```bash
37+
pip uninstall python-solvespace
38+
```
39+
40+
[GNU Make]: https://sourceforge.net/projects/mingw-w64/files/latest/download?source=files
41+
[Cython]: https://cython.org/

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL