Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

niet project.'"test-dash"' /path/to/your/file.yaml does not work #82

Open
novalex98 opened this issue Jan 11, 2024 · 2 comments
Open

niet project.'"test-dash"' /path/to/your/file.yaml does not work #82

novalex98 opened this issue Jan 11, 2024 · 2 comments

Comments

@novalex98
Copy link

The line from the example code "niet project.'"test-dash"' /path/to/your/file.yaml" no longer works.

I created a new environment, pip installed niet, then tried to follow the example. I'm on a Windows 11 machine. The following worked:

py -m venv .venv2
.venv2\Scripts\activate
where python
py -m pip install -U niet
niet ".project.meta.name" example.yml
niet ".project.foo" example.yml
niet ".project.list" example.yml
set NAME=niet ".project.meta.name" example.yml
%NAME%

but I could not get the test-dash field to be read. I tried both with naming my file example.yml and example.yaml so its not the file extension that is at issue. Perhaps downgrading to an earlier version of jmespath would help? This seems related to issue 79.

@4383
Copy link
Member

4383 commented Jan 11, 2024

Hello,

This example works for me:

$ tox -r -e venv -- niet project.'"test-dash"' tests/samples/sample.yaml
venv: remove tox env folder /home/dev/niet/.tox/venv
.pkg: remove tox env folder /home/dev/niet/.tox/.pkg
venv: install_deps> pip install -r /home/dev/niet/test-requirements.txt
.pkg: install_requires> python -I -m pip install 'hatch-vcs>=0.3' 'hatchling>=1.12.2'
.pkg: _optional_hooks> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
.pkg: get_requires_for_build_editable> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
.pkg: build_editable> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
venv: install_package_deps> pip install 'jmespath>=0.9.4' pytoml 'pyyaml>=5.1'
venv: install_package> pip install --force-reinstall --no-deps /home/dev/niet/.tox/.tmp/package/4/niet-3.2.1.dev1+gbe484ee-py3-none-any.whl
venv: commands[0]> niet 'project."test-dash"' tests/samples/sample.yaml
value
.pkg: _exit> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
  venv: OK (8.86=setup[8.76]+cmd[0.10] seconds)
  congratulations :) (8.99 seconds)

Notice that I used the -r flag with tox, which force to recreate the environment and so to pull the requirements from scratch.

Please can you test with the command I used above?

@4383
Copy link
Member

4383 commented Jan 11, 2024

You should notice that I made my test on linux fedora.

I'm not a window user and I don't know how window behave, especially in this scenario with dash.

I don't think the error come from jmespath either.

Can you try with something like that? '.project."test\-dash"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants