Skip to content

Commit d40458d

Browse files
committed
Add separate instructions for macOS arm64 in readme
1 parent cf12149 commit d40458d

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

README.rst

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ 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
75+
diffpy.pdffit2 supports Python 3.11 and 3.12
7676
the following external software:
7777

7878
* ``setuptools`` - software distribution tools for Python
@@ -82,47 +82,59 @@ the following external software:
8282
* ``diffpy.structure`` - simple storage and manipulation of atomic
8383
structures, https://github.com/diffpy/diffpy.structure
8484

85-
----
85+
Windows, macOS (non-Arm64), Linux
86+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8687

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

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

9394
conda config --add channels conda-forge
9495

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`` ::
96+
Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2`` ::
97+
98+
conda create -n diffpy.pdffit2_env diffpy.pdffit2
99+
100+
Activate the environment ::
97101

98-
conda create -n diffpy.pdffit2_env python=3
99102
conda activate diffpy.pdffit2_env
100103

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

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

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.
108+
macOS (Arm64)
109+
~~~~~~~~~~~
106110

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

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

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

115117
pip install diffpy.pdffit2
116118

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 ::
119+
Confirm that the installation was successful ::
120+
121+
python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"
120122

121-
pip install .
123+
Build from source
124+
~~~~~~~~~~~~~~~~
122125

123-
To confirm that the installation was successful, run the following in a terminal ::
126+
For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run ::
124127

125-
python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"
128+
conda create -n diffpy.pdffit2_env python=3.12 \
129+
--file requirements/test.txt \
130+
--file requirements/conda.txt \
131+
--file requirements/build.txt
132+
133+
Run the following commands sequentially to activate the environment, build the package, and run unit tests ::
134+
135+
conda activate diffpy.pdffit2_env
136+
pip install . --no-deps
137+
pytest
126138

127139
Support and Contribute
128140
----------------------

0 commit comments

Comments
 (0)