Coder Social home page Coder Social logo

Comments (5)

ofek avatar ofek commented on August 27, 2024

that is possible if I understand what you're saying https://hatch.pypa.io/latest/config/hatch/#mode

I think I'm going the one that uses that feature lol let me know if it works for your use case

from hatch.

peakschris avatar peakschris commented on August 27, 2024

That's part of the use-case.

But it seems to change the cwd of the script to the project root. I need cwd to remain the directory that I'm invoking the command from. Is that possible?

from hatch.

ofek avatar ofek commented on August 27, 2024

can you show me exactly what you want to do?

from hatch.

peakschris avatar peakschris commented on August 27, 2024

I can try.

  • d:\myhatchproject contains pyproject.toml, src\checkdata.py, checkdata is registered as script
  • d:\data contains data for analysis
  • checkdata is a script that checks datafiles in current directory
  • normally, checkdata is packaged as binary and used
  • but during development, we need to run it from source

Normal usage:

cd d:\data
checkdata --mode=detailed

During Dev, Either:

cd d:\data
hatch --project=d:\myhatchproject run checkdata -- --mode=detailed

Or:

<add myhatchproject to config.yaml>
cd d:\data
hatch --project=myhatchproject run checkdata -- --mode=detailed

from hatch.

ofek avatar ofek commented on August 27, 2024

hatch run ensures that the current directory is somewhere within the project, if not then it will be changed to the project root. You can either work within hatch shell and invoke your command directly or continue using hatch run but pass the current directory as an argument e.g. %PWD%

from hatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.