Skip to content

Commit 248928b

Browse files
authored
fix: from attr import attr, attrs, attrib, Factory ImportError: cannot import name 'attrs' from 'attr' (#127)
* Add tox env verifying plain install (without dev requirements). * Install attrs instead of attr package.
1 parent 9115580 commit 248928b

5 files changed

+14
-7
lines changed

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
'Programming Language :: Python :: 3.12',
2020
]
2121
dependencies = [
22-
"attr",
22+
"attrs",
2323
"boto3",
2424
"click",
2525
"crowdai_api",
@@ -42,6 +42,8 @@ dependencies = [
4242
"recordtype",
4343
"redis",
4444
"seaborn",
45+
# https://docs.python.org/3/whatsnew/3.12.html: Python 3.12 has removed pkg_resources from the standard library (moved to setuptools):
46+
"setuptools",
4547
"svgutils",
4648
"timeout_decorator",
4749

requirements-dev.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ async-lru==2.0.4
2424
# via jupyterlab
2525
async-timeout==5.0.1
2626
# via redis
27-
attr==0.3.2
28-
# via flatland-rl (pyproject.toml)
2927
attrs==25.1.0
3028
# via
3129
# flake8-eradicate
30+
# flatland-rl (pyproject.toml)
3231
# jsonschema
3332
# referencing
3433
babel==2.17.0

requirements-ml.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ async-timeout==5.0.1
2424
# via
2525
# aiohttp
2626
# redis
27-
attr==0.3.2
28-
# via flatland-rl (pyproject.toml)
2927
attrs==25.1.0
3028
# via
3129
# aiohttp
30+
# flatland-rl (pyproject.toml)
3231
# jsonschema
3332
# referencing
3433
boto3==1.36.20

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ asttokens==3.0.0
88
# via stack-data
99
async-timeout==5.0.1
1010
# via redis
11-
attr==0.3.2
11+
attrs==25.1.0
1212
# via flatland-rl (pyproject.toml)
1313
boto3==1.36.20
1414
# via flatland-rl (pyproject.toml)

tox.ini

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
env_list = py{310,311,312},notebooks,py{310,311,312}-ml
2+
env_list = py{310,311,312},notebooks,py{310,311,312}-ml,py{310,311,312}-verify-install
33

44
[gh-actions]
55
python =
@@ -123,3 +123,10 @@ deps =
123123
-r requirements-dev.txt
124124
commands =
125125
python -m build
126+
127+
[testenv:py{310,311,312}-verify-install]
128+
# install flatland-rl without additional dependencies
129+
skip_install = false
130+
commands =
131+
python --version
132+
python -c 'from flatland.evaluators.service import FlatlandRemoteEvaluationService'

0 commit comments

Comments
 (0)