CoolProp / CoolProp.jl

A Julia wrapper for CoolProp, offering access to thermodynamic properties for fluids and mixtures.
http://www.coolprop.org
Other
32 stars 15 forks source link

Update to new julia package manager #6

Closed alblaz closed 5 years ago

alblaz commented 5 years ago

I would like to update the package so that a user could just type ]add https://github.com/CoolProp/CoolProp.jl and have a working version of CoolProp on julia.

In this PR I updated CoolProp.jl to utilize the files Project.toml and Manifest.toml to list all the dependencies of the package. This is the new standard in julia v1. The new package manager bundled with julia 1.x helps in the automatic generation of these files.

Yet, using the new package manager was not sufficient to run successfully ]add https://github.com/alblaz/CoolProp.jl#update-to-julia-v1.0. and I got an error in the build process related to the line const branchname = LibGit2.branch(LibGit2.GitRepo(abspath(@__FILE__, "..", "..")));

In order to get rid of this error I had to force branchname = "master" in build.jl . This is not an ideal fix and I think build.jl should be changed somehow. Yet now it is possible to run ]add https://github.com/alblaz/CoolProp.jl#update-to-julia-v1.0 and build a working CoolProp.jl.

Let me know your thoughts and your suggestions to modify build.jl, Alberto

P.S. I noticed that 2 tests are failing for some reason. The tests are at line 10 and 11 in TestThrows.jl. I commented out these tests temporarily to check that everything else is working.

ibell commented 5 years ago

Is this ready to merge? I think it seems ok, but I'm no Julia expert

alblaz commented 5 years ago

It is possible to merge. It would be good to figure out why the two tests that I commented out are failing but I don't think this should be blocking.

Regarding the build.jl file, right now it downloads only the latest version of CoolProp. I don't think this is a problem but the previous version could download either "latest" or "nightly" versions based on the name of the git branch. This implementation does not work anymore with the new package manager. The new package manager enables to download a package as a developer (]dev https://github.com/CoolProp/CoolProp.jl) or as a user (]add https://github.com/CoolProp/CoolProp.jl). ]dev downloads the whole git repository and is intended for people who wants to modify the original package while ]add downloads only a particular commit (default is the tagged version) and is intended for people who only want to use the package. The bottom line is that there is no git repository locally when performing a ]add https://github.com/CoolProp/CoolProp.jl hence it is not possible to use infos from git branch to choose the URL for the download. This is probably not a problem and perhaps it is enough to be able to download the "latest" version.

ibell commented 5 years ago

I think it is fine to pull from master in general, but it would be nice to have flexibility in that.