Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #137 from SpiNNakerManchester/pyproject.toml
Browse files Browse the repository at this point in the history
Pyproject.toml
  • Loading branch information
Christian-B committed Apr 11, 2023
2 parents 665793e + 2bb0821 commit 1490cde
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include CITATION.cff LICENSE.md requirements.txt pypi_to_import
include LICENSE LICENSE_POLICY.md README.md CITATION.cff diagrams/*
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 . --user

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
=============
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt → pyproject.toml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:"
20 changes: 0 additions & 20 deletions requirements-test.txt

This file was deleted.

67 changes: 67 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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-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
keywords =
spinnaker
data specification model

[options]
python_requires = >=3.7, <4
packages = find:
zip_safe = True
include_package_data = True
install_requires =
SpiNNMachine == 1!6.0.1

[options.packages.find]
include =
data_specification
data_specification.*
diagrams

[options.package_data]
* =
data_specification.cfg
*.dia
*.png

[options.extras_require]
test =
# pytest will be brought in by pytest-cov
pytest-cov
86 changes: 20 additions & 66 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2014 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.
Expand All @@ -12,69 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from collections import defaultdict
import distutils.dir_util
from setuptools import setup
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"
)
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()

0 comments on commit 1490cde

Please sign in to comment.