Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pyproject.toml #11

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .bumpversion.cfg

This file was deleted.

13 changes: 7 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
Expand All @@ -9,21 +8,23 @@ insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8
max_line_length = 180
max_line_length = 179

[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.rst]
indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[LICENSE]
insert_final_newline = false
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.9', '3.10', '3.11']
os: [macos-latest, windows-latest, ubuntu-latest]
python: ['3.10', '3.11']

steps:
- uses: compas-dev/compas-actions.build@v3
- uses: compas-dev/compas-actions.build@v4
with:
python: ${{ matrix.python }}
invoke_lint: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
docs:
runs-on: windows-latest
steps:
- uses: compas-dev/compas-actions.docs@v3
- uses: compas-dev/compas-actions.docs@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
doc_url: https://compas.dev/compas_ifc
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.9', '3.10', '3.11']
os: [macos-latest, windows-latest, ubuntu-latest]
python: ['3.10', '3.11']

steps:
- uses: compas-dev/compas-actions.build@v3
- uses: compas-dev/compas-actions.build@v4
with:
python: ${{ matrix.python }}
invoke_lint: true
Expand All @@ -24,7 +24,7 @@ jobs:
needs: build
runs-on: windows-latest
steps:
- uses: compas-dev/compas-actions.publish@v2
- uses: compas-dev/compas-actions.publish@v3
with:
pypi_token: ${{ secrets.PYPI }}
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Added support to export to `IFC2x3`.
* Added support pre-load geometries using `multi-processing`.

### Changed

* Updated workflow to not use `conda` anymore.
* Updated `Reader` to re-enable lazy loading.
* Update repo to use `pyproject.toml`.

### Removed

Expand Down
9 changes: 9 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import compas_ifc
import math
import numpy
from compas.geometry import allclose


def pytest_ignore_collect(path):
Expand All @@ -15,6 +16,9 @@ def pytest_ignore_collect(path):
if "ghpython" in str(path):
return True

if str(path).endswith("_cli.py"):
return True


@pytest.fixture(autouse=True)
def add_compas(doctest_namespace):
Expand All @@ -34,3 +38,8 @@ def add_math(doctest_namespace):
@pytest.fixture(autouse=True)
def add_np(doctest_namespace):
doctest_namespace["np"] = numpy


@pytest.fixture(autouse=True)
def add_allclose(doctest_namespace):
doctest_namespace["allclose"] = allclose
147 changes: 125 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,129 @@
[tool.black]
line-length = 120
[build-system]
requires = ["setuptools>=66.0"]
build-backend = "setuptools.build_meta"

# ============================================================================
# project info
# ============================================================================

[project]
name = "compas_ifc"
description = "High-level IFC interface for COMPAS."
keywords = ["compas", "ifc", "bim", "interoperability"]
authors = [{ name = "Tom Van Mele", email = "[email protected]" }, { name = "Li Chen", email = "[email protected]" }]
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.9"
dynamic = ['dependencies', 'optional-dependencies', 'version']
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

[project.urls]
Homepage = "https://github.com/compas-dev/compas_ifc"
Documentation = "https://compas.dev/compas_ifc/"
Repository = "https://github.com/compas-dev/compas_ifc.git"
Changelog = "https://github.com/compas-dev/compas_ifc/blob/main/CHANGELOG.md"
Issues = "https://github.com/compas-dev/compas_ifc/issues"
Forum = "https://forum.compas-framework.org/"

# ============================================================================
# setuptools config
# ============================================================================

[tool.setuptools]
package-dir = { "" = "src" }
include-package-data = true
zip-safe = false

[tool.setuptools.dynamic]
version = { attr = "compas_ifc.__version__" }
dependencies = { file = "requirements.txt" }
optional-dependencies = { dev = { file = "requirements-dev.txt" } }

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]

# ============================================================================
# replace pytest.ini
# ============================================================================

[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
python_files = [
"test_*.py",
"tests.py"
testpaths = ["tests", "src/compas_ifc"]
python_files = ["test_*.py", "*_test.py", "test.py"]
addopts = ["-ra", "--strict-markers", "--doctest-glob=*.rst", "--tb=short"]
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ALLOW_UNICODE",
"ALLOW_BYTES",
"NUMBER",
]

# ============================================================================
# replace bumpversion.cfg
# ============================================================================

[tool.bumpversion]
current_version = "0.3.0"
message = "Bump version to {new_version}"
commit = true
tag = true

[[tool.bumpversion.files]]
filename = "src/compas_ifc/__init__.py"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "Unreleased"
replace = "[{new_version}] {now:%Y-%m-%d}"

# ============================================================================
# replace setup.cfg
# ============================================================================

[tool.black]
line-length = 179

[tool.ruff]
line-length = 179
indent-width = 4
target-version = "py39"

[tool.ruff.lint]
select = ["E", "F", "I"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["I001"]
"tests/*" = ["I001"]
"tasks.py" = ["I001"]

[tool.ruff.lint.isort]
force-single-line = true
known-first-party = [
"compas_ifc",
]
addopts = "-ra --strict --doctest-modules --doctest-glob=*.rst --tb=short"
doctest_optionflags= "NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE ALLOW_BYTES NUMBER"
filterwarnings = "ignore::DeprecationWarning"

[tool.isort]
line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
force_single_line = true
ensure_newline_before_comments = true
known_first_party = "compas"
default_section = "THIRDPARTY"
forced_separate = "test_compas"
skip = ["__init__.py"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.pycodestyle]
max-doc-length = 179

[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
22 changes: 4 additions & 18 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
flake8
black
attrs >=17.4
bump2version >=1.0.1
check-manifest >=0.36
compas_invocations
doc8
graphviz
black >=22.12.0
bump-my-version
compas_invocations2
invoke >=0.14
ipykernel
ipython >=5.8
isort
m2r2
nbsphinx
pydocstyle
pytest <7.1
ruff
sphinx_compas2_theme
matplotlib
sphinx
twine
wheel
sphinx_book_theme
-e .
17 changes: 0 additions & 17 deletions setup.cfg

This file was deleted.

Loading
Loading