Skip to content

Commit a79ea71

Browse files
committed
feature: setup.py corrections and proper version
1 parent 5f3c989 commit a79ea71

File tree

5 files changed

+70
-16
lines changed

5 files changed

+70
-16
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include MANIFEST.in
2-
include README.md
2+
include PYPI_README.md
33
include LICENSE

PYPI_README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<p align="center">
2+
<img src="https://raw.githubusercontent.com/ai4er-cdt/gtc-biodiversity/main/docs/images/geograph_logo.png" alt="GeoGraph" width="300px">
3+
</p>
4+
5+
_Created as part of the AI4ER Group Team Challenge 2021 by the Biodiversity Team._
6+
7+
8+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ai4er-cdt/gtc-biodiversity/main?urlpath=lab%2Ftree%2Fnotebooks)
9+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
11+
[![Documentation Status](https://readthedocs.org/projects/geograph/badge/?version=latest)](https://geograph.readthedocs.io/en/latest/?badge=latest)
12+
13+
14+
__Table of contents:__
15+
1. Features
16+
2. Getting started
17+
3. Requirements
18+
4. Documentation
19+
5. Project structure
20+
21+
## 1. Features
22+
23+
GeoGraph provides a full-stack tool for analysing habitat fragmentation, and other related problems. It includes models to predict land cover classes, a method to extract graph structure from the resulting land cover maps and an extensive range of visualisation and analysis tools.
24+
25+
## 2. Getting started
26+
27+
Clone this repository using
28+
29+
```
30+
git clone https://github.com/ai4er-cdt/gtc-biodiversity.git
31+
```
32+
33+
Enter the directory and install the conda environment using
34+
35+
```
36+
cd gtc-biodiversity
37+
make env
38+
```
39+
40+
Done, you're ready to go!
41+
42+
## 3. Requirements
43+
44+
GeoGraph is written in Python 3.8 and builds on [NetworkX](https://github.com/NetworkX/NetworkX), [ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet) and many more packages. See the [requirements directory](./requirements) for a full list of dependencies.
45+
46+
## 4. Documentation
47+
48+
Our documentation is available at [geograph.readthedocs.io](https://geograph.readthedocs.io/).
49+

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://raw.githubusercontent.com/ai4er-cdt/gtc-biodiversity/main/docs/images/geograph_logo.png" alt="GeoGraph" width="300px">
2+
<img src="docs/images/geograph_logo.png" alt="GeoGraph" width="300px">
33
</p>
44

55
_Created as part of the AI4ER Group Team Challenge 2021 by the Biodiversity Team._
@@ -10,7 +10,7 @@ _Created as part of the AI4ER Group Team Challenge 2021 by the Biodiversity Team
1010
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
1111
[![Documentation Status](https://readthedocs.org/projects/geograph/badge/?version=latest)](https://geograph.readthedocs.io/en/latest/?badge=latest)
1212

13-
![GeoGraphViewer demo gif](https://raw.githubusercontent.com/ai4er-cdt/gtc-biodiversity/main/docs/images/viewer_demo.gif)
13+
![GeoGraphViewer demo gif](docs/images/viewer_demo.gif)
1414

1515

1616
__Table of contents:__

geograph/_version.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"""Module to store the __version__ string."""
2+
__version__ = "0.0.1"

setup.py

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
"""Module that defines a setup function and publishes the package to PyPI."""
4+
"""
5+
Module that defines a setup function and publishes the package to PyPI.
6+
7+
Use the command `python setup.py upload`.
8+
"""
59
# Note: To use the "upload" functionality of this file, you must:
610
# $ pip install twine
711

@@ -15,7 +19,7 @@
1519

1620
# Package meta-data.
1721
NAME = "geograph"
18-
DESCRIPTION = "Group Team Challenge 2021; Biodiversity Team."
22+
DESCRIPTION = "Group Team Challenge 2021 - Biodiversity Team"
1923
URL = "https://geograph.readthedocs.io/"
2024
2125
AUTHOR = "Biodiversity Team"
@@ -43,18 +47,17 @@
4347

4448
here = os.path.abspath(os.path.dirname(__file__))
4549

46-
# Import the README and use it as the long-description.
47-
# Note: this will only work if "README.md" is present in your MANIFEST.in file!
50+
# Import the PYPI README and use it as the long-description.
51+
# Note: this will only work if "PYPI_README.md" is present in your MANIFEST.in file!
4852
try:
49-
with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
53+
with io.open(os.path.join(here, "PYPI_README.md"), encoding="utf-8") as f:
5054
long_description = "\n" + f.read()
5155
except FileNotFoundError:
5256
long_description = DESCRIPTION
5357

5458
# Load the package"s _version.py module as a dictionary.
5559
about: Dict = {}
56-
project_slug = "src".lower().replace("-", "_").replace(" ", "_")
57-
with open(os.path.join(here, project_slug, "_version.py")) as f:
60+
with open(os.path.join(here, NAME, "_version.py")) as f:
5861
# pylint: disable=exec-used
5962
exec(f.read(), about)
6063

@@ -77,7 +80,7 @@ def finalize_options(self):
7780
pass
7881

7982
def run(self):
80-
"Publish package to PyPI."
83+
"""Publish package to PyPI."""
8184
try:
8285
self.status("Removing previous builds…")
8386
rmtree(os.path.join(here, "dist"))
@@ -88,11 +91,11 @@ def run(self):
8891
os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))
8992

9093
self.status("Uploading the package to PyPI via Twine…")
91-
os.system("twine upload --repository-url https://test.pypi.org/legacy/ dist/*")
94+
os.system("twine upload dist/*")
9295

93-
# self.status("Pushing git tags…")
94-
# os.system("git tag v{0}".format(about["__version__"]))
95-
# os.system("git push --tags")
96+
self.status("Pushing git tags…")
97+
os.system("git tag v{0}".format(about["__version__"]))
98+
os.system("git push --tags")
9699

97100
sys.exit()
98101

@@ -139,5 +142,5 @@ def run(self):
139142
cmdclass={
140143
"upload": UploadCommand,
141144
},
142-
test_suite="src.tests.test_all.suite",
145+
test_suite="geograph.tests.test_all.suite",
143146
)

0 commit comments

Comments
 (0)