Distribute IfcDiff on PyPI

This commit is contained in:
Dion Moult
2024-06-26 11:44:19 +10:00
parent e670a7ca71
commit 4976074b18
5 changed files with 142 additions and 29 deletions
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifcdiff-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifcdiff &&
make dist
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifcdiff/dist
+38
View File
@@ -0,0 +1,38 @@
# IfcDiff - Compare IFCs
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of IfcDiff.
#
# IfcDiff is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# IfcDiff is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with IfcDiff. If not, see <http://www.gnu.org/licenses/>.
VERSION:=$(shell cat ../../VERSION)
SED:=sed -i
ifeq ($(UNAME_S),Darwin)
SED:=sed -i '' -e
endif
.PHONY: qa
qa:
black .
.PHONY: dist
dist:
rm -rf dist
cp pyproject.toml pyproject.toml.bak
cp ifcdiff.py ifcdiff.py.bak
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' pyproject.toml
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' ifcdiff.py
python -m build
mv pyproject.toml.bak pyproject.toml
mv ifcdiff.py.bak ifcdiff.py
+3
View File
@@ -37,6 +37,9 @@ from deepdiff import DeepDiff
from ordered_set import OrderedSet
__version__ = version = "0.0.0"
class IfcDiff:
"""Main IfcDiff application
+29
View File
@@ -0,0 +1,29 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ifcdiff"
version = "0.0.0"
authors = [
{ name="Dion Moult", email="dion@thinkmoult.com" },
]
description = "Compares the differences between two IFC models"
readme = "README.md"
keywords = ["IFC", "Diff"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
]
dependencies = [
"ifcopenshell",
"deepdiff",
]
[project.urls]
Homepage = "http://ifcopenshell.org"
Documentation = "https://docs.ifcopenshell.org"
Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues"
[tool.setuptools]
py-modules = ["ifcdiff"]
+37 -29
View File
@@ -18,10 +18,45 @@ Changes will be sorted into three lists:
There are different methods of installation, depending on your situation.
1. **Source installation** is recommended for users wanting to use the latest
code as a library or a CLI utility.
1. **PyPI** is recommended for developers using Pip.
2. **Using the BlenderBIM Add-on** is recommended for non-developers wanting a
graphical interface.
3. **Source installation** is recommended for users wanting to use the latest
code as a library or a CLI utility.
PyPI
----
.. code-block::
pip install ifcdiff
Using the BlenderBIM Add-on
---------------------------
The BlenderBIM Add-on is a Blender based graphical interface to IfcOpenShell.
Other than providing a graphical IFC authoring platform, it also comes with
IfcOpenShell, its utilities, and a Python shell built-in. This means you don't
need to install Python first, and you also can compare your IfcOpenShell
scripting to what you see with a visual model viewer, or use a graphical
interface to access the IfcOpenShell utilities.
1. Install the BlenderBIM Add-on by following the `BlenderBIM Add-on
installation documentation
<https://docs.blenderbim.org/users/installation.html>`_.
2. Launch Blender. Change to the **Scene Properties** tab in the **Properties
Panel**. Scroll down to the **IFC Quality Control > IFC Diff** panel.
3. Browse to your old IFC file, new IFC file.
4. Optionally add any relationships you want to check.
5. Optionally type in a filter query.
6. Press **Execute IFC Diff**
TODO: add pictures and make this clearer for non-developers.
Source installation
-------------------
@@ -76,33 +111,6 @@ You can also alias it to a command:
alias ifcdiff='python -m ifcdiff'
Using the BlenderBIM Add-on
---------------------------
The BlenderBIM Add-on is a Blender based graphical interface to IfcOpenShell.
Other than providing a graphical IFC authoring platform, it also comes with
IfcOpenShell, its utilities, and a Python shell built-in. This means you don't
need to install Python first, and you also can compare your IfcOpenShell
scripting to what you see with a visual model viewer, or use a graphical
interface to access the IfcOpenShell utilities.
1. Install the BlenderBIM Add-on by following the `BlenderBIM Add-on
installation documentation
<https://docs.blenderbim.org/users/installation.html>`_.
2. Launch Blender. Change to the **Scene Properties** tab in the **Properties
Panel**. Scroll down to the **IFC Quality Control > IFC Diff** panel.
3. Browse to your old IFC file, new IFC file.
4. Optionally add any relationships you want to check.
5. Optionally type in a filter query.
6. Press **Execute IFC Diff**
TODO: add pictures and make this clearer for non-developers.
Geometry changes
----------------