Comments (3)
Indeed, it passes! That's why I said #102 preserves the behavior of handling multiple assignments, and does not alter it.
I saw a missing test rather as a coverage issue, not an undefined behavior.
Looking at
Lines 169 to 176 in 966d86b
if we try to unpack multiple (or no) nodes in place where one is expected
(node,)
a value error is raised.
Which is why maybe it's a better idea to actually make _read
safe and precisely describe the cases it supports? This is what #102 tried to do, but at the cost of expanding the implementation to imperative approach.
The callee of that function just so happened to suppress ValueError
, so that's why I thought the concern was addressed since the beginning.
from pip-run.
Also, I'll want to test to confirm what is the current behavior.
The following test passes, so the current behavior is to silently ignore both:
diff --git a/tests/test_scripts.py b/tests/test_scripts.py
index 877c0a5..0326b4c 100644
--- a/tests/test_scripts.py
+++ b/tests/test_scripts.py
@@ -56,6 +56,15 @@ class TestSourceDepsReader:
)
assert scripts.DepsReader(script).read() == ['foo']
+ def test_duplicate_definition(self):
+ script = textwrap.dedent(
+ """
+ __requires__=['foo']
+ __requires__=['bar']
+ """
+ )
+ assert scripts.DepsReader(script).read() == []
+
def test_reads_files_with_multiple_assignment(self):
script = textwrap.dedent(
"""
from pip-run.
I've gone ahead and pushed that test, making it an explicitly-tested expectation.
Indeed, it passes! That's why I said #102 preserves the behavior of handling multiple assignments, and does not alter it.
I saw a missing test rather as a coverage issue, not an undefined behavior.
Thanks. Yeah, that was my mis-read on the intention there.
from pip-run.
Related Issues (20)
- Support parsing PIP_RUN_RETENTION_STRATEGY from a script HOT 3
- Consider renaming PIP_RUN_MODE HOT 1
- Improved sophistication of environment strategies HOT 2
- What is "py" in the README.md? HOT 3
- New mode - in-memory install HOT 5
- Pre-install pip-run in the GitHub Actions runner images HOT 4
- PEP 723 compatibility HOT 2
- Deprecate the "comment" format for declaring dependencies HOT 1
- 12.6.0 installs `/usr/lib/python*/site-packages/tests` HOT 6
- Support `uv` as an alternative package installer HOT 8
- Error tearing down an environment with a shared library (Windows)
- New mode - persist resolved dependencies HOT 4
- Revisit the installation strategy HOT 8
- Exception handling in DepsReader.read_python is inconsistent
- Support reading annotated variables HOT 5
- Make `read-deps` `script` parameter accept directories HOT 2
- Deprecate `__requires__ : str` HOT 1
- Remove inline whitespaces from particular requirements from `read-deps` HOT 1
- More visible error on broken inputs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pip-run.