From d40458daab7380d787bfe89fe0d5d0821135c54d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 10:50:12 -0500 Subject: [PATCH 1/5] Add separate instructions for macOS arm64 in readme --- README.rst | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index 88ee7fa..163c3f6 100644 --- a/README.rst +++ b/README.rst @@ -72,7 +72,7 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 requires Python 3.11 or later and +diffpy.pdffit2 supports Python 3.11 and 3.12 the following external software: * ``setuptools`` - software distribution tools for Python @@ -82,47 +82,59 @@ the following external software: * ``diffpy.structure`` - simple storage and manipulation of atomic structures, https://github.com/diffpy/diffpy.structure ----- +Windows, macOS (non-Arm64), Linux +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. -To add "conda-forge" to the conda channels, run the following in a terminal. :: +Add the "conda-forge" channel by running the following command in a terminal: conda config --add channels conda-forge -We want to install our packages in a suitable conda environment. -The following creates and activates a new environment named ``diffpy.pdffit2_env`` :: +Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2`` :: + + conda create -n diffpy.pdffit2_env diffpy.pdffit2 + +Activate the environment :: - conda create -n diffpy.pdffit2_env python=3 conda activate diffpy.pdffit2_env -Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: +Confirm that the installation was successful :: - conda install diffpy.pdffit2 + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -The less preferred approach is the install using ``pip`` to download and install the latest release from `Python Package Index `_. 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. +macOS (Arm64) +~~~~~~~~~~~ -To install the C++ compiler and required dependencies in your ``diffpy.pdffit2_env`` environment, type :: +Create a new conda environment ``diffpy.pdffit2_env`` :: - conda install \ - --file requirements/run.txt \ - --file requirements/build.txt + conda create -n diffpy.pdffit2_env python=3.12 -And then type :: +Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_ :: pip install diffpy.pdffit2 -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 -`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory -and run the following :: +Confirm that the installation was successful :: + + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" - pip install . +Build from source +~~~~~~~~~~~~~~~~ -To confirm that the installation was successful, run the following in a terminal :: +For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run :: - python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" + conda create -n diffpy.pdffit2_env python=3.12 \ + --file requirements/test.txt \ + --file requirements/conda.txt \ + --file requirements/build.txt + +Run the following commands sequentially to activate the environment, build the package, and run unit tests :: + + conda activate diffpy.pdffit2_env + pip install . --no-deps + pytest Support and Contribute ---------------------- From a064fb1d32bb01c2c232677edcc37aca74c839f0 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 10:53:35 -0500 Subject: [PATCH 2/5] Add news --- news/readme-install.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/readme-install.rst diff --git a/news/readme-install.rst b/news/readme-install.rst new file mode 100644 index 0000000..0ad7f57 --- /dev/null +++ b/news/readme-install.rst @@ -0,0 +1,23 @@ +**Added:** + +* Separate installation instruction for macOS (Arm64) in READEM + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 41a2231e2dc42cfed37b8c26b80f0b1551357aaa Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 10:57:42 -0500 Subject: [PATCH 3/5] Fix syntax and wording to improve readability --- README.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 163c3f6..b52b9a6 100644 --- a/README.rst +++ b/README.rst @@ -93,30 +93,30 @@ Add the "conda-forge" channel by running the following command in a terminal: conda config --add channels conda-forge -Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2`` :: +Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2``: :: conda create -n diffpy.pdffit2_env diffpy.pdffit2 -Activate the environment :: +Activate the environment: :: conda activate diffpy.pdffit2_env -Confirm that the installation was successful :: +Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" macOS (Arm64) ~~~~~~~~~~~ -Create a new conda environment ``diffpy.pdffit2_env`` :: +Create a new conda environment ``diffpy.pdffit2_env``: :: conda create -n diffpy.pdffit2_env python=3.12 -Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_ :: +Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: pip install diffpy.pdffit2 -Confirm that the installation was successful :: +Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" @@ -130,7 +130,7 @@ For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` dir --file requirements/conda.txt \ --file requirements/build.txt -Run the following commands sequentially to activate the environment, build the package, and run unit tests :: +Activate the environment, build the package, and run unit tests by following commands sequentially: :: conda activate diffpy.pdffit2_env pip install . --no-deps From 9595eff035c19808bbe38a45660a776d02214931 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 11:05:23 -0500 Subject: [PATCH 4/5] Re-run empty commit to see if codecov passes From 207fb45b940709bcf6b5b18732ec604fff8d8ae2 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 22:04:38 -0500 Subject: [PATCH 5/5] Remove build dependencies in readme --- README.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.rst b/README.rst index b52b9a6..0dddaf3 100644 --- a/README.rst +++ b/README.rst @@ -73,14 +73,6 @@ Installation ------------ diffpy.pdffit2 supports Python 3.11 and 3.12 -the following external software: - -* ``setuptools`` - software distribution tools for Python -* ``python-dev`` - header files for interfacing Python with C -* ``GSL`` - GNU Scientific Library for C -* ``g++`` - GNU C++ compiler -* ``diffpy.structure`` - simple storage and manipulation of atomic - structures, https://github.com/diffpy/diffpy.structure Windows, macOS (non-Arm64), Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -89,7 +81,7 @@ The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. -Add the "conda-forge" channel by running the following command in a terminal: +Add the "conda-forge" channel by running the following command in a terminal: :: conda config --add channels conda-forge