Skip to content

Commit 1b0de23

Browse files
authored
Merge pull request #105 from bobleesj/readme-install
Add separate install instructions for macOS Arm64 users in readme
2 parents cf12149 + 207fb45 commit 1b0de23

File tree

2 files changed

+55
-28
lines changed

2 files changed

+55
-28
lines changed

README.rst

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -72,57 +72,61 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite
7272
Installation
7373
------------
7474

75-
diffpy.pdffit2 requires Python 3.11 or later and
76-
the following external software:
75+
diffpy.pdffit2 supports Python 3.11 and 3.12
7776

78-
* ``setuptools`` - software distribution tools for Python
79-
* ``python-dev`` - header files for interfacing Python with C
80-
* ``GSL`` - GNU Scientific Library for C
81-
* ``g++`` - GNU C++ compiler
82-
* ``diffpy.structure`` - simple storage and manipulation of atomic
83-
structures, https://github.com/diffpy/diffpy.structure
84-
85-
----
77+
Windows, macOS (non-Arm64), Linux
78+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8679

8780
The preferred method is to use `Miniconda Python
8881
<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
8982
and install from the "conda-forge" channel of Conda packages.
9083

91-
To add "conda-forge" to the conda channels, run the following in a terminal. ::
84+
Add the "conda-forge" channel by running the following command in a terminal: ::
9285

9386
conda config --add channels conda-forge
9487

95-
We want to install our packages in a suitable conda environment.
96-
The following creates and activates a new environment named ``diffpy.pdffit2_env`` ::
88+
Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2``: ::
89+
90+
conda create -n diffpy.pdffit2_env diffpy.pdffit2
91+
92+
Activate the environment: ::
9793

98-
conda create -n diffpy.pdffit2_env python=3
9994
conda activate diffpy.pdffit2_env
10095

101-
Then, to fully install ``diffpy.pdffit2`` in our active environment, run ::
96+
Confirm that the installation was successful: ::
10297

103-
conda install diffpy.pdffit2
98+
python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"
10499

105-
The less preferred approach is the install using ``pip`` to download and install the latest release from `Python Package Index <https://pypi.python.org>`_. In this case you currently have to build the codes on your computer from the sources and you will have to have a C++ installer available.
100+
macOS (Arm64)
101+
~~~~~~~~~~~
106102

107-
To install the C++ compiler and required dependencies in your ``diffpy.pdffit2_env`` environment, type ::
103+
Create a new conda environment ``diffpy.pdffit2_env``: ::
108104

109-
conda install \
110-
--file requirements/run.txt \
111-
--file requirements/build.txt
105+
conda create -n diffpy.pdffit2_env python=3.12
112106

113-
And then type ::
107+
Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index <https://pypi.python.org>`_: ::
114108

115109
pip install diffpy.pdffit2
116110

117-
If you prefer to install from sources, use the above ``conda install \ ..`` instruction to install the dependencies in ``run.txt`` and ``build.txt`` in ``diffpy.pdffit2_env`` , obtain the source archive from
118-
`GitHub <https://github.com/diffpy/diffpy.pdffit2/>`_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory
119-
and run the following ::
111+
Confirm that the installation was successful: ::
120112

121-
pip install .
113+
python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"
122114

123-
To confirm that the installation was successful, run the following in a terminal ::
115+
Build from source
116+
~~~~~~~~~~~~~~~~
124117

125-
python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"
118+
For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run ::
119+
120+
conda create -n diffpy.pdffit2_env python=3.12 \
121+
--file requirements/test.txt \
122+
--file requirements/conda.txt \
123+
--file requirements/build.txt
124+
125+
Activate the environment, build the package, and run unit tests by following commands sequentially: ::
126+
127+
conda activate diffpy.pdffit2_env
128+
pip install . --no-deps
129+
pytest
126130

127131
Support and Contribute
128132
----------------------

news/readme-install.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Separate installation instruction for macOS (Arm64) in READEM
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

0 commit comments

Comments
 (0)