Skip to content

Commit

Permalink
Merge pull request #51 from calpolyccg/create-nix-build
Browse files Browse the repository at this point in the history
Create nix build of MD-SAPT
  • Loading branch information
ALescoulie authored Jun 24, 2024
2 parents 4a289a1 + c5225b5 commit 3331c37
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ wheels/
*.egg-info/
.installed.cfg
*.egg
result/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An MDAnalysis-kit for calculating SAPT of molecular dynamics trajectories in psi

### Installation

Installing with Conda on Python version 3.9 to 3.11 using the command:
Installing with Conda on Python version 3.9 to 3.11 on either MacOS (arm or x86) or Linux using the command:

``` bash
conda install -c conda-forge mdsapt
Expand All @@ -25,7 +25,18 @@ git clone https://github.com/calpolyccg/MDSAPT.git
pip install ./MDSAPT
```

A development environment can also be created using nix:
If you use [nix](https://nixos.wiki/) MD-SAPT can be also be build with:

```
git clone https://github.com/calpolyccg/MDSAPT.git
cd MDSAPT
nix build
```

You can also incorporate it to a project managed with nix by adding it to the imports of your `flake.nix` or `shell.nix`.

### Contributing
A development environment can be created using nix:

``` bash
git clone https://github.com/calpolyccg/MDSAPT.git
Expand Down
10 changes: 10 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ Alternatively, it can be installed by cloning the GitHub repository.
git clone https://github.com/calpolyccg/MDSAPT.git
pip install ./MDSAPT
If you use [nix](https://nixos.wiki/) MD-SAPT can be also be build with:

```
git clone https://github.com/calpolyccg/MDSAPT.git
cd MDSAPT
nix build
```

You can also incorporate it to a project managed with nix by adding it to the imports of your `flake.nix` or `shell.nix`.

To ensure it's been installed correctly, run `mdsapt` or `python3 -m mdsapt`.

.. code-block:: bash
Expand Down
23 changes: 20 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
mrcfile = [ "setuptools" ];
griddataformats = [ "setuptools" ];
pyright = [ "setuptools" ];
#matplotlib = [ "pybind11" ];
#scipy = [ "setuptools" "wheel" "pybind11" "pythran" ];
};

p2n-overrides = pkgs.poetry2nix.defaultPoetryOverrides.extend (final: prev:
Expand Down Expand Up @@ -60,16 +58,35 @@
overrides = [ p2n-overrides unfuckScipy unfuckNumpy ]; #unfuckScipy ];
};

nonPoetryPkgs = final: prev: {
psi4 = pkgs.qchem.psi4;
openmm = pkgs.qchem.openmm;
pdbfixer = pkgs.qchem.pdbfixer;
};

devEnv = pkgs.mkShell {
propagatedBuildInputs = [ poetryEnv];
propagatedBuildInputs = [ poetryEnv ];
buildInputs = with pkgs; [pkgs.qchem.psi4 pkgs.qchem.openmm pkgs.qchem.pdbfixer pkgs.act ];
};


# DON'T FORGET TO PUT YOUR PACKAGE NAME HERE, REMOVING `throw`
packageName = "MD-SAPT";


app = pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
python = python;
overrides = [ p2n-overrides nonPoetryPkgs unfuckScipy unfuckNumpy ];

};


in {
packages.${packageName} = app;
packages.default = self.packages.${system}.${packageName};
devShells.default = devEnv;

});
}

12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[tool.poetry]
name = "mdsapt"
version = "2.0.3"
version = "2.0.4"
description = "SAPT energy calculator built using MDAnalysis and Psi4"
authors = ["Alia Lescoulie <[email protected]>"]
authors = [
"Alia Lescoulie <[email protected]>",
"Astrid Yu <[email protected]",
"Ashley Ringer McDonald <[email protected]"]
license = "GPL-3.0"
readme = "README.md"

Expand All @@ -22,8 +25,9 @@ pytest-cov = "^5.0.0"
autopep8 = "^2.2.0"
pydantic = "^2.7.4"



[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
mdsapt = "mdsapt:cli"

0 comments on commit 3331c37

Please sign in to comment.