Giter Club home page Giter Club logo

Comments (7)

gha3mi avatar gha3mi commented on June 15, 2024 1

I'm happy that you find it interesting.

To answer your question, I created a new project on my local machine using fpm (0.9.0, alpha). I included two examples from ForColormap and ForImage as tests in the 'test' folder. I added my forked version of ForColormap as a dependency, as well as ForImage. The examples work correctly in my test project, which means fpm manages them correctly.

[dependencies]
forcolormap = { git = "https://github.com/gha3mi/forcolormap" }
forimage = { git = "https://github.com/gha3mi/forimage.git" }

Removing ForImage from dependencies has no effect, which means users of ForColormap only need to add ForColormap as a dependency, and fpm knows that ForColormap depends on ForImage.

[dependencies]
forcolormap = { git = "https://github.com/gha3mi/forcolormap" }

If a user wants to use ForImage in their project as well, they can add ForImage as a dependency without any issues; fpm seems to have no problem and works correctly. If you want to check these tests, I can share my simple test project with you.

If a user accidentally adds the same dependency twice using fpm, it will result in an error:

[dependencies]
forcolormap = { git = "https://github.com/gha3mi/forcolormap" }
forimage = { git = "https://github.com/gha3mi/forimage.git" }
forimage = { git = "https://github.com/gha3mi/forimage.git" }
<ERROR> *cmd_run* Package error: error: Key 'forimage' already exists
  --> fpm.toml:10:1-8
   |
 9 | forimage = { git = "https://github.com/gha3mi/forimage.git" }
   | -------- first defined here
10 | forimage = { git = "https://github.com/gha3mi/forimage.git" }
   | ^^^^^^^^ key already used
   |
STOP 1

from forcolormap.

gha3mi avatar gha3mi commented on June 15, 2024 1

There is only one. See the build directory:

build/
├── cache.toml
├── dependencies
│   ├── forcolormap
│   │   ├── CHANGELOG.md
│   │   ├── example
│   │   │   ├── demo.f90
│   │   │   └── example1.f90
│   │   ├── fpm.toml
│   │   ├── LICENSE
│   │   ├── NO_BIJECTION.md
│   │   ├── README.md
│   │   ├── scripts
│   │   │   ├── copy-paste_code.f90
│   │   │   ├── cp_lut_files.sh
│   │   │   ├── generate_scmap.f90
│   │   │   └── scientific_colour_maps.f90
│   │   ├── src
│   │   │   ├── colormap_class.f90
│   │   │   └── scientific_colour_maps.f90
│   │   ├── test
│   │   │   └── check.f90
│   │   └── test_map_to_load.txt
│   └── forimage
│       ├── example
│       │   ├── example10.f90
│       │   ├── example11.f90
│       │   ├── example12.f90
│       │   ├── example13.f90
│       │   ├── example14.f90
│       │   ├── example1.f90
│       │   ├── example2.f90
│       │   ├── example3.f90
│       │   ├── example4.f90
│       │   ├── example5.f90
│       │   ├── example6.f90
│       │   ├── example7.f90
│       │   ├── example8.f90
│       │   └── example9.f90
│       ├── ford.yml
│       ├── fpm.rsp
│       ├── fpm.toml
│       ├── LICENSE
│       ├── media
│       │   ├── logo.png
│       │   └── logo.svg
│       ├── pnm_files
│       │   ├── example1_ascii_ex.pbm
│       │   ├── example1_ascii.pbm
│       │   ├── example2_ascii_ex.pgm
│       │   ├── example2_ascii.pgm
│       │   ├── example3_ascii_ex.ppm
│       │   ├── example3_ascii.ppm
│       │   ├── example4_binary_ex.pbm
│       │   ├── example4_binary.pbm
│       │   ├── example5_binary_ex.pgm
│       │   ├── example5_binary.pgm
│       │   ├── example6_ascii_to_binary_ex.ppm
│       │   ├── example6_binary_ex.ppm
│       │   ├── example6_binary.ppm
│       │   └── example6_binary_to_ascii_ex.ppm
│       ├── README.md
│       ├── src
│       │   └── forimage.f90
│       ├── VERSION
│       └── workspace.code-workspace
├── gfortran_50F62D7499E64B65
│   └── test
│       ├── libtest.a
│       └── libtest.a.log
└── gfortran_87E2AE0597D39913
    ├── test
    │   ├── src_test.f90.o
    │   ├── src_test.f90.o.digest
    │   └── src_test.f90.o.log
    └── test.mod

from forcolormap.

vmagnin avatar vmagnin commented on June 15, 2024 1

Well, the fpm guys did a great job...

I will consider the merge tomorrow.

from forcolormap.

gha3mi avatar gha3mi commented on June 15, 2024 1

Exactly!
Thanks, I will send a PR.

from forcolormap.

vmagnin avatar vmagnin commented on June 15, 2024 1

Can you just before put again a 4 spaces indentation in the file example/demo.f90 ? (to stay coherent)
Thanks Ali @gha3mi

from forcolormap.

vmagnin avatar vmagnin commented on June 15, 2024

Thanks Ali @gha3mi for that work! That's an interesting contribution.

I was just wondering about dependencies in fpm: if forimage is a dependency of forcolormap, what happens if a user creates a project without being conscious of that fact and puts in its own fpm.toml file the two dependencies?

[dependencies]
forimage = {git="https://github.com/gha3mi/forimage.git"}
forcolormap = {git="https://github.com/vmagnin/forcolormap.git"}

Will fpm correctly manage the fact that forimage is declared two times as a dependency?

from forcolormap.

vmagnin avatar vmagnin commented on June 15, 2024

Thanks for testing.
And in your test build/ directory, is forimage built only once? or two times? (one time for the test and one in a subdirectory for forcolormap)

from forcolormap.

Related Issues (6)

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.