Skip to content

Commit

Permalink
Merge pull request #33 from fusion-energy/updating_package_method
Browse files Browse the repository at this point in the history
moved to src pyproject
  • Loading branch information
shimwell authored Nov 1, 2022
2 parents 81fbc23 + 5f5937c commit bbe3910
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 54 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/conda-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: conda-build-test

on:
workflow_dispatch:
pull_request:
branches:
- develop
- main

jobs:
build:
runs-on: ubuntu-latest
container: continuumio/miniconda3:4.10.3

steps:
- uses: actions/checkout@v2

- name: Set up conda
run: |
apt-get --allow-releaseinfo-change update
apt install -y libgl1-mesa-glx
conda install -y anaconda-client conda-build
conda config --set anaconda_upload no
- name: Build and test
env:
GIT_DESCRIBE_TAG: 0.1
run: |
conda build conda -c cadquery -c conda-forge --config-file conda/conda_build_config.yaml
6 changes: 3 additions & 3 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ source:

build:
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt
script: python -m pip install --no-deps --ignore-installed .

requirements:
build:
- python {{ python }}
- setuptools>=46.4.0
- setuptools_scm>=6.3.1
- setuptools>=65.4.0
- setuptools_scm>=7.0.5
run:
- python {{ python }}
- cadquery {{ cadquery }}
Expand Down
42 changes: 36 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
[build-system]
requires = [
"setuptools >= 46.4.0",
"wheel",
"setuptools_scm[toml] >= 6.3.1",
]
requires = ["setuptools >= 65.4.0", "setuptools_scm[toml]>=7.0.5"]
build-backend = "setuptools.build_meta"

[project]
name = "brep_part_finder"
authors = [
{ name="Jonathan Shimwell", email="[email protected]" },
]
license = {file = "LICENSE.txt"}
description = "A Python package to identify the part ID number in Brep format CAD files"
readme = "README.md"
requires-python = ">=3.8"
keywords = ["brep", "geometry", "part", "find", "identify", "volume"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"numpy>=1.21.1",
]
dynamic = ["version"]


[tool.setuptools_scm]
write_to = "brep_part_finder/_version.py"
write_to = "src/brep_part_finder/_version.py"


[project.optional-dependencies]
tests = [
"pytest",
]

[project.urls]
"Homepage" = "https://github.com/fusion-energy/brep_part_finder"
"Bug Tracker" = "https://github.com/fusion-energy/brep_part_finder/issues"

[tool.setuptools]
package-dir = {"" = "src"}
38 changes: 0 additions & 38 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

File renamed without changes.
9 changes: 6 additions & 3 deletions brep_part_finder/core.py → src/brep_part_finder/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ def get_matching_part_id(
center: a tuple of x,y,z coordinates
bounding_box: a tuple of two coordinates where the coordinates are the
lower left and upper right corners of the bounding box.
volume_atol: absolute tolerance acceptable on the volume comparision
center_atol: absolute tolerance acceptable on the center comparision
bounding_box_atol: absolute tolerance acceptable on the bounding box comparision
volume_atol: absolute tolerance acceptable on the volume comparison
center_atol: absolute tolerance acceptable on the center comparison
bounding_box_atol: absolute tolerance acceptable on the bounding box comparison
"""

part_ids_matching = {}
Expand Down Expand Up @@ -199,6 +199,9 @@ def get_matching_part_id(
for key2, value2 in value.items():
print(f" {key2}, {value2}")

if lists_of_matching_parts_separate == []:
raise ValueError("No matching part found")

lists_of_matching_parts = list(
set.intersection(*map(set, lists_of_matching_parts_separate))
)
Expand Down

0 comments on commit bbe3910

Please sign in to comment.