fortran-lang / fpm

Fortran Package Manager (fpm)
https://fpm.fortran-lang.org
MIT License
868 stars 97 forks source link

make `fpm new` automatically add a line to fpm.toml to enforce prefixes for module names #854

Closed certik closed 1 year ago

certik commented 1 year ago

This should be added:

module-naming = true

together with the minimal required version (#855). The new package author can decide, what version should be required. If older version is required, then the author can remove the module-naming line.

There is an issue that if we do that, and build the project with an older fpm version, it will fail to build, see https://github.com/toml-f/toml-f/pull/121 for an example of that. The solution to this is described at https://github.com/fortran-lang/fpm/issues/855.

perazz commented 1 year ago

Thank you @certik, with the on-going module-naming and metapackage efforts, fpm new now deploys manifest files with all options:

federico@Federicos-MacBook-Pro test_fpm_new % fpmx new testprog
federico@Federicos-MacBook-Pro test_fpm_new % cat testprog/fpm.toml 
name = "testprog"
version = "0.1.0"
license = "license"
author = "Federico Perini"
maintainer = "xxxxxx.yyyyy@zzzzz.abc"
copyright = "Copyright 2023"
[build]
auto-executables = true
auto-tests = true
auto-examples = true
module-naming = false
openmp = false
stdlib = false
[install]
library = false

My question for you and @fortran-lang/admins is: I originally thought [build] is a good place to start from, because we're basically talking package dependencies which affect the build process. But as this list is expanding, should we create an [environment] category instead? It's starting to look more like conda environments, even more when we implement version enforcing.

perazz commented 1 year ago

I will close this as completed, thank you @certik.