Skip to content

Commit c538ab6

Browse files
committed
chore(pep517): Using setup.cfg + pyproject.toml for build the .whl package
1 parent 21a046b commit c538ab6

File tree

8 files changed

+69
-45
lines changed

8 files changed

+69
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ venv/
112112
ENV/
113113
env.bak/
114114
venv.bak/
115+
version.py
115116

116117
# Spyder project settings
117118
.spyderproject

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,20 @@ Quick way:
6868
pip install surface_reconstruction
6969
```
7070

71-
Or clone this repository and run from the project root:
71+
Or clone this repository and build the `.whl` file from the project root:
7272

7373
```bash
74-
python setup.py install
74+
cd [your-project-root]
75+
76+
# Build the .whl package file
77+
python -m build --sdist --wheel .
78+
79+
# Install locally from the .whl file
80+
# Where: x.x.x is the generated version from git tag
81+
pip install dist/surface_reconstruction-x.x.x-py3-none-any.whl
7582
```
83+
> For more detailed, see the Wiki pages in: [Generate package](https://github.com/mfdeveloper/surface_reconstruction_python/wiki/Generate-package)
84+
7685

7786
### Run the unit tests
7887

pyproject.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
[build-system]
2-
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
3-
4-
[tool.setuptools_scm]
5-
write_to = "surface_reconstruction/version.py"
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "surface_reconstruction/version.py"
7+
version_scheme = "python-simplified-semver"
8+
# Adds +dirty if the current workdir has changes
9+
local_scheme = "dirty-tag"

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ setuptools~=54.1.0
55
wheel~=0.36.2
66
twine~=3.3.0
77
tqdm~=4.59.0
8-
setuptools-scm~=5.0.2
8+
setuptools-scm~=5.0.2
9+
build==0.3.1

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
open3d==0.12.0
2-
pymeshlab==0.2
3-
numpy~=1.20.1
1+
--index-url https://pypi.python.org/simple/
2+
3+
.

setup.cfg

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Reference: https://setuptools.readthedocs.io/en/latest/build_meta.html
2+
3+
[metadata]
4+
name = surface_reconstruction
5+
author = Felipe Michel Ferreira
6+
author_email = mfelipeof@gmail.com
7+
description = Import a point cloud file and perform poisson 3D surface reconstruction algorithm, integrated with third-party libraries (e.g. open3d, pymeshlab...)
8+
long_description = file: README.md
9+
long_description_content_type = text/markdown
10+
url = https://github.com/mfdeveloper/surface_reconstruction_python
11+
keywords = point-cloud, surface-reconstruction, 3d-processor, 3d-rendering, 3D, poisson, open3d, meshlab
12+
license = MIT
13+
classifiers =
14+
License :: OSI Approved :: MIT License
15+
Operating System :: OS Independent
16+
Topic :: Multimedia :: Graphics :: 3D Rendering
17+
Environment :: GPU
18+
Development Status :: 5 - Production/Stable
19+
Programming Language :: Python :: 3
20+
Programming Language :: Python :: 3.8
21+
22+
[options]
23+
include_package_data = True
24+
python_requires = >=3.3
25+
packages = find:
26+
install_requires =
27+
open3d ==0.12
28+
pymeshlab ==0.2
29+
numpy
30+
31+
[options.data_files]
32+
data =
33+
files/complex_terrain/list_vertex.ply
34+
files/simple_terrain/list_vertex.ply
35+
files/filter_scripts/filter_script.mlx

setup.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ param (
33
[string]
44
$VirtualEnvFolder = 'venv',
55
[bool]
6+
$Force = $true,
7+
[bool]
68
$Execute = $true
79
)
810

@@ -148,7 +150,6 @@ function Mount-Virtual-Env {
148150
#>
149151
[CmdletBinding()]
150152
param (
151-
[Parameter(Mandatory = $false)]
152153
[string]
153154
$FolderName = 'venv'
154155
)
@@ -157,6 +158,11 @@ function Mount-Virtual-Env {
157158
Write-Error "The virtualenv folder '$FolderName' is invalid"
158159
return $false
159160
}
161+
162+
if ($Force) {
163+
Write-Host "Removing folder '$FolderName' ..."
164+
Remove-Item ".\$FolderName" -Force
165+
}
160166

161167
if ( -not(Test-Path ".\$FolderName") ) {
162168
Write-Host 'Creating Python VIRTUAL ENVIRONMENT:'
@@ -202,7 +208,7 @@ function Install-Packages-Dependencies {
202208
}
203209

204210
if (!$invokedInstall) {
205-
Write-Information 'requirements.txt file was not found'
211+
Write-Host 'requirements.txt file was not found'
206212
}
207213

208214
}

setup.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)