diff --git a/.github/workflows/ci-ifcdiff-pypi.yaml b/.github/workflows/ci-ifcdiff-pypi.yaml new file mode 100644 index 0000000000..654357409b --- /dev/null +++ b/.github/workflows/ci-ifcdiff-pypi.yaml @@ -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 diff --git a/src/ifcdiff/Makefile b/src/ifcdiff/Makefile new file mode 100644 index 0000000000..5f9eb9818a --- /dev/null +++ b/src/ifcdiff/Makefile @@ -0,0 +1,38 @@ +# IfcDiff - Compare IFCs +# Copyright (C) 2020, 2021 Dion Moult +# +# 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 . + +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 diff --git a/src/ifcdiff/ifcdiff.py b/src/ifcdiff/ifcdiff.py index 001bf7e967..391b4f3fbd 100755 --- a/src/ifcdiff/ifcdiff.py +++ b/src/ifcdiff/ifcdiff.py @@ -37,6 +37,9 @@ from deepdiff import DeepDiff from ordered_set import OrderedSet +__version__ = version = "0.0.0" + + class IfcDiff: """Main IfcDiff application diff --git a/src/ifcdiff/pyproject.toml b/src/ifcdiff/pyproject.toml new file mode 100644 index 0000000000..128df11763 --- /dev/null +++ b/src/ifcdiff/pyproject.toml @@ -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"] diff --git a/src/ifcopenshell-python/docs/ifcdiff.rst b/src/ifcopenshell-python/docs/ifcdiff.rst index 3ea22f9b7e..713df85ad9 100644 --- a/src/ifcopenshell-python/docs/ifcdiff.rst +++ b/src/ifcopenshell-python/docs/ifcdiff.rst @@ -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 + `_. + +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 - `_. - -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 ----------------