Skip to content

Commit

Permalink
Merge pull request #1330 from compas-dev/modernise-config
Browse files Browse the repository at this point in the history
Modernise config
  • Loading branch information
tomvanmele committed Apr 23, 2024
2 parents 16897f4 + c12b440 commit 86b1a99
Show file tree
Hide file tree
Showing 22 changed files with 249 additions and 287 deletions.
29 changes: 0 additions & 29 deletions .bumpversion.cfg

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: compas-dev/compas-actions.build@v3
- uses: compas-dev/compas-actions.build@v4
with:
invoke_lint: true
invoke_test: true
python: ${{ matrix.python }}
invoke_lint: true
4 changes: 2 additions & 2 deletions .github/workflows/ironpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: "[RPC tests] Set up CPython 3.8"
- name: "[RPC tests] Set up CPython 3.9"
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: "[RPC tests] Install CPython dependencies"
run: |
python -m pip install --upgrade pip
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
tags:
- 'v*'
- "v*"

name: Create Release

Expand All @@ -11,20 +11,21 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: compas-dev/compas-actions.build@v3
- uses: compas-dev/compas-actions.build@v4
with:
python: ${{ matrix.python }}
invoke_lint: true
invoke_test: true
python: ${{ matrix.python }}
check_import: true

publish:
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 }}
Expand Down
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fixed bug in `compas.topology.orientation.unify_cycles`.
* Fixed bug in `Mesh.thickened`.
* Fixed various bugs in `compas.geometry.Quaternion`.

* Changed repo config to `pyproject.toml`.

### Removed

* Removed `compas.scene.SceneObjectNode`, functionalities merged into `compas.scene.SceneObject`.
* Removed `compas.scene.SceneTree`, functionalities merged into `compas.scene.Scene`.


## [2.1.0] 2024-03-01

### Added
Expand All @@ -52,7 +51,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed


## [2.0.4] 2024-02-12

### Added
Expand All @@ -63,7 +61,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed


## [2.0.3] 2024-02-09

### Added
Expand Down
24 changes: 0 additions & 24 deletions MANIFEST.in

This file was deleted.

8 changes: 3 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
import compas
import math

import numpy
import pytest

import compas
from compas.geometry import allclose


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

if "matlab" in str(path):
return True

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

Expand Down
177 changes: 155 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,159 @@
[tool.black]
line-length = 120
[build-system]
requires = ["setuptools>=66.0"]
build-backend = "setuptools.build_meta"

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

[project]
name = "compas"
description = "The main COMPAS framework library."
keywords = ["architecture", "engineering", "fabrication", "construction"]
authors = [{ name = "tom van mele", email = "tom.v.mele@gmail.com" }]
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",
"Programming Language :: Python :: 3.12",
]

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

[project.scripts]
compas_rpc = "compas.rpc.__main__:main"

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

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

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

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

[tool.setuptools.package-data]
"compas.colors.cmcrameri" = ["*.txt"]
"compas.data.samples" = ["*.obj", "*.stl", "*.off", "*.ply", "*.json"]

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

[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
python_files = [
"test_*.py",
"tests.py"
testpaths = ["tests", "src/compas"]
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",
]
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"]

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

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

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

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

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

[[tool.bumpversion.files]]
filename = "src/compas_rhino/__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]
# we should set this to 179
line-length = 120

[tool.ruff]
# we should set this to 179
line-length = 120
indent-width = 4
target-version = "py39"

[tool.ruff.lint]
# we should add "I"
select = ["E", "F"]
# we should remove this
ignore = ["E501"]

[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",
"compas_blender",
"compas_ghpython",
"compas_rhino",
]

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

[tool.ruff.lint.pycodestyle]
# we should set this to 179
max-doc-length = 120

[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
13 changes: 4 additions & 9 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
attrs >=17.4
black
bump2version >=1.0.1
check-manifest >=0.36
compas_invocations
doc8
flake8
importlib_metadata <5.0
black >=22.12.0
bump-my-version
compas_invocations2
invoke >=0.14
isort
ruff
sphinx_compas2_theme
twine
wheel
-e .
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ jsonschema
networkx >= 3.0
numpy >= 1.15.4
scipy >= 1.1
typing_extensions
watchdog; sys_platform != 'emscripten'
17 changes: 0 additions & 17 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit 86b1a99

Please sign in to comment.