Comments (11)
Okay, but following the default setup from the DrWatson docs my Project.toml
has no UUID. So I cannot ]dev .
. Any idea there?
from drwatson.jl.
Hi @jessebett , thanks for opening this. I will now address your questions, and I hope I can resolve your confusions. Before that though, I need to stress the following point:
- DrWatson is not a package to help you develop a Julia package. It is a package to help you manage your scientific project, which is represented by a Julia project. Notice that a Julia project does not have to be a Julia package. (But by definition, a Julia package is always a Julia project).
As you have already mentioned:
And that doesn't address that Project.toml has no UUID by default, so this is likely not the intended method to develop the project.
That is correct and is on purpose. The Project.toml
file represents your scientific project, not a Julia package. What I assume you want to do is include a Julia package you are developing inside your own project.
This is how I do it, and how I suggest you do it:
Above, kwant_graphene
, is my scientific project, which is also a Julia project, and is initialized by DrWatson. I use DrWatson throughout this project. In my src
folder you will first see that I have some casual script files that define core functions, e.g. HusimiPlotting.jl
. These files I normally include
in all my script.
What you will see is that inside my project's src
folder I also have two Julia packages, Chebyshev, HusimiFunctions
. These are proper Julia packages in every sense of the way. I develop them normally and include them in my project normally using using HusimiFunctions
and update them in real time with e.g. Revise. To create this setup you need the following steps:
- Active your project that uses DrWatson.
- Change directory to the project's
src
folder. - Go into package mode and initialize a package with the name that you want (in my case
HusimiFunctions
) dev
the local path toHusimiFunctions
using the package manager , e.g.dev /path/to/project/src/HusimiFunctions
. It is strongly recommended todev
this using local paths instead, see this PR that will be merged soon: JuliaLang/Pkg.jl#1215
That is it.
If this solves your concerns please let me know and I will put it into DrWatson's documentation as is.
from drwatson.jl.
Hi @Datseris. Yes, you are correct that my issue was conflating packages and projects. I've compartmentalized the package into its own sub-directory as you've suggested and it works for me. I agree that this could be worth highlighting in the docs.
from drwatson.jl.
You can dev any project with a Project.toml that has a name, UUID, and src/ProjectName.jl. That will play well with Revise AFAIK - it just informs Julia that the package will change.
from drwatson.jl.
Further, if I get a uuid
from Pkg.generate
and put it in there, I cannot ]dev .
because, understandably, ERROR: Cannot develop package with same name or uuid as the project
.
from drwatson.jl.
Switch to the global env and then dev it? Should work then.
from drwatson.jl.
Switch to the global env, dev it, then switch back? Or are you proposing I work inside the global env which would defeat the whole purpose of working in a project, no?
from drwatson.jl.
And that doesn't address that Project.toml
has no UUID by default, so this is likely not the intended method to develop the project.
I already have a patch (which is to push the srcdir
to the LOAD_PATH
but I'm trying to learn the correct/intended way to do this, instead of workarounds. It seems to me that if I have to manually generate a UUID, add it to the Project.toml
and ]dev
from outside my project env, then something isn't right.
The main consideration is that this should be easily reproducible. That I should be able to just hand this repo to someone else and have it work. That definitely won't be easy if there needs to be messing with LOAD_PATH
or environments to get the scripts to work with using MyModule
...
from drwatson.jl.
@jessebett can you please tell me if this was okay for you?
from drwatson.jl.
Thanks, will do so soon! :)
from drwatson.jl.
Might also be worth using git submodules? Could be too much hassle though...
from drwatson.jl.
Related Issues (20)
- DOCS: make example project CamelCase instead of it having space in its name HOT 2
- Allow `dict_list` to return other types than dictionaries
- GitReference should be LibGit2.GitReference HOT 1
- Use a project name without a space in the examples in the documentation HOT 3
- Dev docukentation build seems to not update
- ERROR: Package DrWatson errored during testing HOT 3
- ERROR: LoadError: Some tests did not pass: 354 passed, 11 failed, 9 errored, 0 broken.
- [DISCUSSION] Using DrWatson for Non-Simulation Based Projects HOT 2
- Pristine initialize_project provides Warning and subsequent quickactivate does not work HOT 2
- Is there a way to leave a project? HOT 2
- v2.12.2 breaks compatibility of produce_or_load() and datadir() HOT 2
- Slashes removed in #380 HOT 2
- `rinclude` argument in `collect_results` finds matches in the absolute path
- tag with git commit message HOT 4
- "verbose &&" before @info "Scanning folder $folder for result files." HOT 2
- `savename` with Unitful `Quantity`s HOT 3
- produce_or_load doubles filename prefixes HOT 5
- collect_results handles .jld2 with groups incorrectly HOT 4
- Make a project to be a module by default HOT 2
- Move to Julia 1.9, use extensions remove Requires for `collect_results` and Dataframes
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 drwatson.jl.