Skip to content

Commit 899c3f2

Browse files
committed
packaging
1 parent 681633b commit 899c3f2

File tree

5 files changed

+103
-25
lines changed

5 files changed

+103
-25
lines changed

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Robert Hafner <tedivm@tedivm.com>, @dzhu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
SHELL:=/bin/bash
3+
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
4+
5+
.PHONY: all fresh dependencies install fulluninstall uninstall removedeps
6+
7+
all: dependencies
8+
9+
clean:
10+
rm -rf $(ROOT_DIR)/screepsapi/*.pyc
11+
# Remove existing environment
12+
if [ -d $(ROOT_DIR)/env ]; then \
13+
rm -rf $(ROOT_DIR)/env; \
14+
fi;
15+
if [ -d $(ROOT_DIR)/dist ]; then \
16+
rm -rf $(ROOT_DIR)/dist; \
17+
fi;
18+
if [ -d $(ROOT_DIR)/build ]; then \
19+
rm -rf $(ROOT_DIR)/build; \
20+
fi;
21+
if [ -d $(ROOT_DIR)/screepsapi.egg-info ]; then \
22+
rm -rf $(ROOT_DIR)/screepsapi.egg-info; \
23+
fi;
24+
25+
dependencies:
26+
if [ ! -d $(ROOT_DIR)/env ]; then python3 -m venv $(ROOT_DIR)/env; fi
27+
source $(ROOT_DIR)/env/bin/activate; yes w | python -m pip install -e .[dev]
28+
29+
package:
30+
source $(ROOT_DIR)/env/bin/activate; python setup.py bdist_wheel --universal

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[metadata]
2+
description-file = README.md
3+
universal=1

setup.py

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,50 @@
1+
# Always prefer setuptools over distutils
2+
from setuptools import setup, find_packages
3+
14
try:
2-
from setuptools import setup
3-
except ImportError:
4-
from distutils.core import setup
5-
6-
config = {
7-
'description': 'Screeps API',
8-
'author': 'dzhu, tedivm',
9-
'url': 'https://github.com/screepers/screeps-api',
10-
'download_url': 'https://github.com/screepers/screeps-api/releases',
11-
'author_email': 'tedivm@tedivm.com',
12-
'version': '0.2',
13-
'install_requires': [
14-
'nose',
15-
'requires',
16-
'requests>=2.10.0,<3',
17-
'websocket-client'
18-
],
19-
'packages': ['screepsapi'],
20-
'scripts': [],
21-
'name': 'screepsapi'
22-
}
23-
24-
setup(**config)
5+
import pypandoc
6+
long_description = pypandoc.convert('README.md', 'rst')
7+
except(IOError, ImportError):
8+
long_description = open('README.md').read()
9+
10+
11+
version = '0.3.0'
12+
setup(
13+
name = 'screepsapi',
14+
version = version,
15+
packages=find_packages(),
16+
17+
description = 'Screeps Unofficial Client for the Unofficial API',
18+
long_description=long_description,
19+
python_requires='>=2',
20+
21+
author = 'Robert Hafner, dzhu',
22+
author_email = 'tedivm@tedivm.com',
23+
url = 'https://github.com/screepers/screeps-api',
24+
download_url = "https://github.com/screepers/screeps-api/archive/v%s.tar.gz" % (version),
25+
keywords = 'screeps api',
26+
27+
classifiers = [
28+
'Development Status :: 4 - Beta',
29+
'License :: OSI Approved :: MIT License',
30+
'Intended Audience :: Developers',
31+
'Programming Language :: Python :: 3',
32+
'Programming Language :: Python :: 2',
33+
],
34+
35+
install_requires=[
36+
'nose',
37+
'requires',
38+
'requests>=2.10.0,<3',
39+
'websocket-client'
40+
],
41+
42+
extras_require={
43+
'dev': [
44+
'pypandoc',
45+
'twine',
46+
'wheel'
47+
],
48+
},
49+
50+
)

0 commit comments

Comments
 (0)