From 2726848824b35dd8b54ac2d7987cd66396a8f82d Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 20 Mar 2023 16:35:15 +0000 Subject: [PATCH 01/14] pyproject.toml --- requirements.txt => pyproject.toml | 7 +-- requirements-test.txt | 20 -------- setup.cfg | 55 ++++++++++++++++++++ setup.py | 80 ------------------------------ 4 files changed, 59 insertions(+), 103 deletions(-) rename requirements.txt => pyproject.toml (80%) delete mode 100644 requirements-test.txt create mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/requirements.txt b/pyproject.toml similarity index 80% rename from requirements.txt rename to pyproject.toml index 0b027fb..4e9ac99 100644 --- a/requirements.txt +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 The University of Manchester +# Copyright (c) 2023 The University of Manchester # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,5 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -SpiNNUtilities == 1!6.0.1 -SpiNNMachine == 1!6.0.1 +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta:" \ No newline at end of file diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index ef52acf..0000000 --- a/requirements-test.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2017 The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - --r requirements.txt -flake8 -coverage >= 4.4, < 5.0 -# pytest will be brought in by pytest-cov -pytest-cov -sphinx >= 4 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..bac998b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,55 @@ +# Copyright (c) 2023 The University of Manchester +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[metadata] +name = SpiNNaker_DataSpecification +version = attr: data_specification._version.__version__ +description="Specification of Memory Images" +long_description = file: README.md +long_description_content_type = text/markdown +url="https://github.com/SpiNNakerManchester/DataSpecification" +license="Apache License 2.0" +classifiers=[ + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + Intended Audience :: Science/Research + License :: OSI Approved :: Apache License 2.0 + Natural Language :: English + Operating System :: POSIX :: Linux + Operating System :: Microsoft :: Windows + Operating System :: MacOS + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 +maintainer="SpiNNakerTeam" +maintainer_email="spinnakerusers@googlegroups.com" + +[options] +python_requires = >=3.7, <4 +packages = find: +zip_safe = True +include_package_data = True +install_requires = + SpiNNMachine == 1!6.0.1 + +[options.extras_require] +test = + flake8 >= 5.0 + coverage >= 4.4, < 5.0 + # pytest will be brought in by pytest-cov + pytest-cov + sphinx >= 4 diff --git a/setup.py b/setup.py deleted file mode 100644 index b78a521..0000000 --- a/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) 2014 The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from collections import defaultdict -import os -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -__version__ = None -exec(open("data_specification/_version.py").read()) -assert __version__ - -# Build a list of all project modules, as well as supplementary files -main_package = "data_specification" -extensions = {".aplx", ".boot", ".cfg", ".json", ".sql", ".template", ".xml", - ".xsd"} -main_package_dir = os.path.join(os.path.dirname(__file__), main_package) -start = len(main_package_dir) -packages = [] -package_data = defaultdict(list) -for dirname, dirnames, filenames in os.walk(main_package_dir): - if '__init__.py' in filenames: - package = "{}{}".format( - main_package, dirname[start:].replace(os.sep, '.')) - packages.append(package) - for filename in filenames: - _, ext = os.path.splitext(filename) - if ext in extensions: - package = "{}{}".format( - main_package, dirname[start:].replace(os.sep, '.')) - package_data[package].append(filename) - -setup( - name="SpiNNaker_DataSpecification", - version=__version__, - description="Specification of Memory Images", - url="https://github.com/SpiNNakerManchester/DataSpecification", - license="Apache License 2.0", - classifiers=[ - "Development Status :: 5 - Production/Stable", - - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - - "License :: OSI Approved :: Apache License 2.0", - - "Natural Language :: English", - - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Operating System :: MacOS", - - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - packages=packages, - package_data=package_data, - install_requires=[ - 'SpiNNUtilities == 1!6.0.1', - 'SpiNNMachine == 1!6.0.1'], - maintainer="SpiNNakerTeam", - maintainer_email="spinnakerusers@googlegroups.com" -) From b631671f454b05bd2bb52010be8ab7eba5e03ce8 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 20 Mar 2023 16:40:33 +0000 Subject: [PATCH 02/14] install actions --- .github/workflows/python_actions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 9b968c7..1d43f44 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -47,13 +47,13 @@ jobs: uses: ./support/actions/python-tools - name: Install Spinnaker Dependencies - uses: ./support/actions/checkout-spinn-deps + uses: ./support/actions/install-spinn-deps with: repositories: SpiNNUtils SpiNNMachine install: true - - name: Setup - uses: ./support/actions/run-setup + - name: Run Install + uses: ./support/actions/run-install - name: Test with pytest uses: ./support/actions/pytest From 68d1789b4017e1bf995aee3db712b7b871080d7e Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 20 Mar 2023 17:00:49 +0000 Subject: [PATCH 03/14] version from init --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bac998b..4cd8008 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ [metadata] name = SpiNNaker_DataSpecification -version = attr: data_specification._version.__version__ +version = attr: data_specification.__version__ description="Specification of Memory Images" long_description = file: README.md long_description_content_type = text/markdown From 32f2c0395fa28091f99a2fc16b3eb67ef5b1a20a Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 21 Mar 2023 06:13:50 +0000 Subject: [PATCH 04/14] get version from _version.py --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4cd8008..bac998b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ [metadata] name = SpiNNaker_DataSpecification -version = attr: data_specification.__version__ +version = attr: data_specification._version.__version__ description="Specification of Memory Images" long_description = file: README.md long_description_content_type = text/markdown From ef870732e03e58638c584d38e22f94a38511e495 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 21 Mar 2023 13:16:09 +0000 Subject: [PATCH 05/14] removed incorrect [ --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bac998b..c09998a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ long_description = file: README.md long_description_content_type = text/markdown url="https://github.com/SpiNNakerManchester/DataSpecification" license="Apache License 2.0" -classifiers=[ +classifiers= Development Status :: 5 - Production/Stable Intended Audience :: Developers Intended Audience :: Science/Research From d1f12772c9dcf21cbf1581bf31a407c58cd3dea2 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 28 Mar 2023 11:01:11 +0100 Subject: [PATCH 06/14] minor setup.cfg changes --- setup.cfg | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index c09998a..f8e48b7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,12 +15,12 @@ [metadata] name = SpiNNaker_DataSpecification version = attr: data_specification._version.__version__ -description="Specification of Memory Images" +description = Specification of Memory Images long_description = file: README.md long_description_content_type = text/markdown -url="https://github.com/SpiNNakerManchester/DataSpecification" -license="Apache License 2.0" -classifiers= +url= https://github.com/SpiNNakerManchester/DataSpecification +license = Apache-2.0 +classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers Intended Audience :: Science/Research @@ -35,8 +35,11 @@ classifiers= Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 -maintainer="SpiNNakerTeam" -maintainer_email="spinnakerusers@googlegroups.com" +maintainer = SpiNNakerTeam +maintainer_email = spinnakerusers@googlegroups.com +keywords = + spinnaker + data specification model [options] python_requires = >=3.7, <4 From f704e0fff7ccba51583f38fa360adf5712a6dd49 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 28 Mar 2023 11:01:45 +0100 Subject: [PATCH 07/14] dont try to use setup.py --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fdf1e38..e5e2bf4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,12 +36,12 @@ jobs: - name: Install pip, etc uses: ./support/actions/python-tools - name: Install Spinnaker Dependencies - uses: ./support/actions/checkout-spinn-deps + uses: ./support/actions/install-spinn-deps with: repositories: SpiNNUtils SpiNNMachine install: true - name: Setup - uses: ./support/actions/run-setup + uses: ./support/actions/run-install - name: Build Python Documentation uses: ./support/actions/sphinx From 6ca901b5d46595d310d05cb90cc03430e18f1508 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 28 Mar 2023 15:28:36 +0100 Subject: [PATCH 08/14] dummy setup.py --- setup.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ae0950d --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +# Copyright (c) 2023 The University of Manchester +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from setuptools import setup +if __name__ == '__main__': + setup() From abca5ac0daf5016e9a4ede87489e58d1d489d709 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 30 Mar 2023 16:58:12 +0100 Subject: [PATCH 09/14] leave the install of coverage,flake8, pylint and spinx to the scripts --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index f8e48b7..8e37322 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,8 +51,5 @@ install_requires = [options.extras_require] test = - flake8 >= 5.0 - coverage >= 4.4, < 5.0 # pytest will be brought in by pytest-cov pytest-cov - sphinx >= 4 From 737615510d0bdb7cfb109425d14bc2de86f3098c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Fri, 31 Mar 2023 07:33:40 +0100 Subject: [PATCH 10/14] include diagrams --- setup.cfg | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 8e37322..65f2bdf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,8 +16,8 @@ name = SpiNNaker_DataSpecification version = attr: data_specification._version.__version__ description = Specification of Memory Images -long_description = file: README.md -long_description_content_type = text/markdown +#long_description = file: README.md +#long_description_content_type = text/markdown url= https://github.com/SpiNNakerManchester/DataSpecification license = Apache-2.0 classifiers = @@ -49,6 +49,16 @@ include_package_data = True install_requires = SpiNNMachine == 1!6.0.1 +[options.packages.find] +include = + data_specification + diagrams + +[options.package_data] +diagrams = + *.dia + *.png + [options.extras_require] test = # pytest will be brought in by pytest-cov From 607da1eb9b42a504e89983a5d6f8e3ad72e82da2 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 3 Apr 2023 11:17:31 +0100 Subject: [PATCH 11/14] cleanup setup --- MANIFEST.in | 2 +- setup.cfg | 3 ++- setup.py | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 8606192..a3a1a9b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include CITATION.cff LICENSE.md requirements.txt pypi_to_import \ No newline at end of file +include LICENSE LICENSE_POLICY.md README.md CITATION.cff diagrams/* \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 65f2bdf..bec5030 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,10 +52,11 @@ install_requires = [options.packages.find] include = data_specification + data_specification.* diagrams [options.package_data] -diagrams = +* = *.dia *.png diff --git a/setup.py b/setup.py index ae0950d..e36866e 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. +import distutils.dir_util from setuptools import setup +import os +import sys + + if __name__ == '__main__': + # Repeated installs assume files have not changed + # https://github.com/pypa/setuptools/issues/3236 + if len(sys.argv) > 0 and sys.argv[1] == 'egg_info': + # on the first call to setpy.py remove files left by previous install + this_dir = os.path.dirname(os.path.abspath(__file__)) + build_dir = os.path.join(this_dir, "build") + if os.path.isdir(build_dir): + distutils.dir_util.remove_tree(build_dir) + egg_dir = os.path.join( + this_dir, "SpiNNaker_DataSpecification.egg-info") + if os.path.isdir(egg_dir): + distutils.dir_util.remove_tree(egg_dir) setup() From 969369c7005e846e7b93b4a064e5097b50df7942 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 3 Apr 2023 15:18:24 +0100 Subject: [PATCH 12/14] include cfg file --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index bec5030..3ebc589 100644 --- a/setup.cfg +++ b/setup.cfg @@ -57,6 +57,7 @@ include = [options.package_data] * = + data_specification.cfg *.dia *.png From e3d26c0dc4fd37d1555d2de4b32d862d45777ef1 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Apr 2023 14:02:07 +0100 Subject: [PATCH 13/14] ipdate install info --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9d44b44..57b7a77 100644 --- a/README.md +++ b/README.md @@ -42,16 +42,22 @@ the git repository: To install as a development version which all users will then be able to use, run the following where the code has been extracted: - sudo python setup.py develop + sudo pip install -e . To install as a development version for only yourself, run: - python setup.py develop --user + pip install -e . To install as a development version in a `virtualenv`, with the `virutalenv` enabled, run: - python setup.py develop + pip install -e . + +Test Installation +================= +To be able to run the unitests add [Test] to the pip installs above + + pip install -e .[Test] Documentation ============= From 2bb0821b027f638f74dd6b87695d4b9976bcb289 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Apr 2023 14:13:52 +0100 Subject: [PATCH 14/14] pip install -e . --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57b7a77..97ce8f9 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ run the following where the code has been extracted: To install as a development version for only yourself, run: - pip install -e . + pip install -e . --user To install as a development version in a `virtualenv`, with the `virutalenv` enabled, run: