mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
build(bcf): remove conda dependency
This commit is contained in:
committed by
Dion Moult
parent
1d78e05370
commit
ac81169290
+2
-22
@@ -1,31 +1,11 @@
|
|||||||
.PHONY: test
|
.PHONY: ci
|
||||||
test:
|
ci:
|
||||||
tox
|
tox
|
||||||
|
|
||||||
.PHONY: qa
|
|
||||||
qa:
|
|
||||||
black .
|
|
||||||
isort .
|
|
||||||
pylint ./src --output-format=colorized
|
|
||||||
|
|
||||||
.PHONY: typecheck
|
|
||||||
typecheck:
|
|
||||||
mypy src/bcf
|
|
||||||
|
|
||||||
.PHONY: license
|
.PHONY: license
|
||||||
license:
|
license:
|
||||||
copyright-header --license LGPL3 --copyright-holder "Andrea Ghensi <andrea.ghensi@gmail.com>" --copyright-year "2022" --copyright-software "IfcOpenShell" --copyright-software-description "BCF XML file handling" -a ./ -o ./
|
copyright-header --license LGPL3 --copyright-holder "Andrea Ghensi <andrea.ghensi@gmail.com>" --copyright-year "2022" --copyright-software "IfcOpenShell" --copyright-software-description "BCF XML file handling" -a ./ -o ./
|
||||||
|
|
||||||
.PHONY: coverage
|
|
||||||
coverage:
|
|
||||||
coverage run --source bcf -m pytest tests
|
|
||||||
coverage html
|
|
||||||
xdg-open htmlcov/index.html
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
rm -rf htmlcov
|
|
||||||
|
|
||||||
# TODO: make this based on xsd file presence
|
# TODO: make this based on xsd file presence
|
||||||
.PHONY: models
|
.PHONY: models
|
||||||
models:
|
models:
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
name: bcf-client
|
|
||||||
channels:
|
|
||||||
- conda-forge
|
|
||||||
dependencies:
|
|
||||||
- ifcopenshell
|
|
||||||
- xsdata
|
|
||||||
- numpy
|
|
||||||
+22
-7
@@ -15,6 +15,7 @@ keywords = ["IFC", "BCF", "BIM", "eingineering"]
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"xsdata",
|
"xsdata",
|
||||||
"numpy",
|
"numpy",
|
||||||
|
"ifcopenshell",
|
||||||
]
|
]
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
@@ -58,20 +59,34 @@ exclude_lines = [
|
|||||||
[tool.tox]
|
[tool.tox]
|
||||||
legacy_tox_ini = """
|
legacy_tox_ini = """
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py310
|
env_list = lint, type, py3{10,11}
|
||||||
isolated_build = true
|
|
||||||
skip_missing_interpreters = true
|
skip_missing_interpreters = true
|
||||||
requires = tox-conda
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
conda_deps =
|
deps =
|
||||||
pytest
|
pytest
|
||||||
pytest-cov
|
pytest-cov
|
||||||
coverage
|
coverage
|
||||||
conda_channels =
|
|
||||||
conda-forge
|
|
||||||
conda_env = environment.yml
|
|
||||||
commands = pytest --cov --cov-report=term tests
|
commands = pytest --cov --cov-report=term tests
|
||||||
|
|
||||||
|
[testenv:lint]
|
||||||
|
description = run linters
|
||||||
|
skip_install = true
|
||||||
|
deps =
|
||||||
|
black
|
||||||
|
isort
|
||||||
|
pylint
|
||||||
|
commands =
|
||||||
|
black {posargs:.}
|
||||||
|
isort {posargs:.}
|
||||||
|
pylint {posargs:.} --output-format=colorized
|
||||||
|
|
||||||
|
[testenv:type]
|
||||||
|
description = run type checks
|
||||||
|
deps =
|
||||||
|
mypy>=0.991
|
||||||
|
commands =
|
||||||
|
- mypy {posargs:src}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
|
|||||||
@@ -4,4 +4,3 @@ pylint
|
|||||||
isort
|
isort
|
||||||
xsdata
|
xsdata
|
||||||
tox==3.27.1
|
tox==3.27.1
|
||||||
tox-conda
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ from pathlib import Path
|
|||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
|
|
||||||
from bcf.v2.bcfxml import BcfXml as BcfXml2
|
from bcf.v2.bcfxml import BcfXml as BcfXml2
|
||||||
from bcf.v3.bcfxml import BcfXml as BcfXml3
|
|
||||||
from bcf.v2.model import Version as Version2
|
from bcf.v2.model import Version as Version2
|
||||||
|
from bcf.v3.bcfxml import BcfXml as BcfXml3
|
||||||
from bcf.v3.model import Version as Version3
|
from bcf.v3.model import Version as Version3
|
||||||
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
|
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"""BCF XML V2 Topic handler."""
|
"""BCF XML V2 Topic handler."""
|
||||||
|
import datetime
|
||||||
|
import tempfile
|
||||||
import uuid
|
import uuid
|
||||||
import zipfile
|
import zipfile
|
||||||
import tempfile
|
|
||||||
import datetime
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, NoReturn, Optional
|
from typing import Any, NoReturn, Optional
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,9 @@ class TopicHandler:
|
|||||||
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
|
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
|
||||||
if self.topic.viewpoints is None:
|
if self.topic.viewpoints is None:
|
||||||
self.topic.viewpoints = mdl.TopicViewpoints()
|
self.topic.viewpoints = mdl.TopicViewpoints()
|
||||||
self.topic.viewpoints.view_point.append(mdl.ViewPoint(viewpoint=new_viewpoint.guid + ".bcfv", guid=new_viewpoint.guid))
|
self.topic.viewpoints.view_point.append(
|
||||||
|
mdl.ViewPoint(viewpoint=new_viewpoint.guid + ".bcfv", guid=new_viewpoint.guid)
|
||||||
|
)
|
||||||
|
|
||||||
def __eq__(self, other: object) -> bool | NoReturn:
|
def __eq__(self, other: object) -> bool | NoReturn:
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def test_create_clash_set_bcf() -> None:
|
|||||||
assert len(topic.viewpoints) == 1
|
assert len(topic.viewpoints) == 1
|
||||||
guid, vi_handler = next((k, v) for k, v in topic.viewpoints.items())
|
guid, vi_handler = next((k, v) for k, v in topic.viewpoints.items())
|
||||||
v_info = vi_handler.visualization_info
|
v_info = vi_handler.visualization_info
|
||||||
assert v_info.guid == guid
|
assert f"{v_info.guid}.bcfv" == guid
|
||||||
components = v_info.components.selection.component
|
components = v_info.components.selection.component
|
||||||
assert {c.ifc_guid for c in components} == {"firstId", "secondId"}
|
assert {c.ifc_guid for c in components} == {"firstId", "secondId"}
|
||||||
camera = v_info.perspective_camera
|
camera = v_info.perspective_camera
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def test_create_clash_set_bcf() -> None:
|
|||||||
assert len(topic.viewpoints) == 1
|
assert len(topic.viewpoints) == 1
|
||||||
guid, vi_handler = next((k, v) for k, v in topic.viewpoints.items())
|
guid, vi_handler = next((k, v) for k, v in topic.viewpoints.items())
|
||||||
v_info = vi_handler.visualization_info
|
v_info = vi_handler.visualization_info
|
||||||
assert v_info.guid == guid
|
assert f"{v_info.guid}.bcfv" == guid
|
||||||
components = v_info.components.selection.component
|
components = v_info.components.selection.component
|
||||||
assert {c.ifc_guid for c in components} == {"firstId", "secondId"}
|
assert {c.ifc_guid for c in components} == {"firstId", "secondId"}
|
||||||
camera = v_info.perspective_camera
|
camera = v_info.perspective_camera
|
||||||
|
|||||||
Reference in New Issue
Block a user