Comments (5)
Hi, thanks for reporting!
The fact that the plugin works once you comment out the lines proves that:
- you've installed the plugin correctly
- the problem is related to the pyproject.toml parsing logic
The lines you're refering to ensure that the tool
section in the pyproject is what we expect. They are needed because the plugin runs on any poetry command and hence must not error out on a variety of edge cases, e.g. when you run install for the first time on a new project, the tool
section may be empty. In normal circumstances it should be an instance of tomlkit Table
.
In the PR above I tried to reproduce the problem by using tomlkit directly to parse an example file. The test passes.
To help debug this further, could you:
- provide an entire pyproject file that causes the issue (you can trim it down and test locally in a new poetry env)
- manually add a print statement next to the lines you've commented out to check what the
tools
variable is and its type, e.g.print(tools) print(type(tools))
Given this information, we can hopefully create a failing test case for me to address or find a formatting problem in your pyproject.toml
from poetry-auto-export.
I have the same issue. Commenting the lines out wshayes mentions also fixes it for me. Thanks for the plugin :)
[tool.poetry]
name = "SomeName"
version = "0.1.0"
description = ""
authors = ["Me"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
promptflow = "1.6.0"
[tool.poetry.group.dev.dependencies]
pytest = "*"
pytest-cov = "*"
flake8 = "*"
flake8-docstrings = "*"
mypy = "*"
isort = "*"
autoflake = "*"
yapf = "*"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[[tool.poetry-auto-export.exports]]
output = "dev-requirements.txt"
without_hashes = true
from poetry-auto-export.
I have the same issue. Commenting the lines out wshayes mentions also fixes it for me. Thanks for the plugin :)
[tool.poetry]
name = "SomeName"
version = "0.1.0"
description = ""
authors = ["Me"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
promptflow = "1.6.0"
[tool.poetry.group.dev.dependencies]
pytest = "*"
pytest-cov = "*"
flake8 = "*"
flake8-docstrings = "*"
mypy = "*"
isort = "*"
autoflake = "*"
yapf = "*"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[[tool.poetry-auto-export.exports]]
output = "dev-requirements.txt"
without_hashes = true
from poetry-auto-export.
Thanks @martinmoldrup. I was able to reproduce and fix the issue with the file you've provided.
The problem here is related to some weird (but apparently useful) guts of tomlkit.
I've added a test for this case and relaxed the type check a bit in #8 . I'll create a new release shortly. Could you update the package and let me know if it works for you? @wshayes , I hope this solves your problem as well!
from poetry-auto-export.
I had the same problem as the reporter had, and I can confirm that 0.2.1 fixes the problem for me at least.
from poetry-auto-export.
Related Issues (3)
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 poetry-auto-export.