Skip to content
Commits on Source (5)
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
<!-- Please search existing issues to avoid creating duplicates. -->
#### Code Sample, a copy-pastable example if possible
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you:
http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
```python
# Your code here
```
#### Problem description
[this should explain **why** the current behavior is a problem and why the expected output is a better solution.]
#### Expected Output
#### Environment Information
<!-- If you have pyproj>=2.2.1 -->
- Output from: `python -c "import pyproj; pyproj.show_versions()"`
<!-- If you have pyproj<2.2.1 -->
- pyproj version (`python -c "import pyproj; print(pyproj.__version__)"`)
- PROJ version (`python -c "import pyproj; print(pyproj.proj_version_str)"`)
- PROJ data directory (`python -c "import pyproj; print(pyproj.datadir.get_data_dir())"`)
- Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`)
- Operation System Information (`python -c "import platform; print(platform.platform())"`)
#### Installation method
- conda, pip wheel, from source, etc...
#### Conda environment information (if you installed with conda):
<br/>
Environment (<code>conda list</code>):
<details>
```
$ conda list | grep -E "proj|aenum"
```
</details>
<br/>
Details about <code>conda</code> and system ( <code>conda info</code> ):
<details>
```
$ conda info
```
</details>
---
name: Feature request
about: Suggest an idea for this project
labels: proposal
---
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Describe the feature you'd like. -->
\ No newline at end of file
---
name: Installation issues
about: Issues installing pyproj (http://pyproj4.github.io/pyproj/stable/installation.html)
labels: installation-issues
---
<!-- Please search existing issues to avoid creating duplicates. -->
#### Installation method/steps
- Installation method (conda, pip wheel, from source, etc...)
- How did you install PROJ? Where is it installed?
- Please provide all commands/steps you used to install pyproj and PROJ.
#### Environment Information
- pyproj version you are attempting to install
- PROJ version (Execute `proj` command and give version here.)
- Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`)
- Operation System Information (`python -c "import platform; print(platform.platform())"`)
---
name: Question
about: Please search existing issues or GIS Stack Exchange (https://gis.stackexchange.com/questions/tagged/pyproj) to avoid creating duplicates
labels: question
---
<!--
Please search existing issues to avoid creating duplicates.
Please check if someone has already asked the same/similar question on GIS Stack Exchange https://gis.stackexchange.com/questions/tagged/pyproj.
Issues installing pyproj?
Have you seen: http://pyproj4.github.io/pyproj/stable/installation.html
-->
\ No newline at end of file
<!-- Feel free to remove check-list items aren't relevant to your change -->
- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Fully documented, including `history.rst` for all changes and `api/*.rst` for new API
\ No newline at end of file
pyproj/proj_dir/
pyproj/*.c
pyproj/*.html
proj-*/
# Byte-compiled / optimized / DLL files
......
......@@ -2,9 +2,14 @@ language: python
sudo: false
cache: pip
cache:
directories:
- $PROJ_BASE_DIR
- $HOME/.cache/pip
env:
global:
- PROJ_BASE_DIR=$HOME/proj_install
- CYTHON_COVERAGE=True
- PROJSOURCE=6.1.0
# Following generated with
......@@ -68,29 +73,32 @@ before_install:
sudo apt-get install -qq sqlite3 libsqlite3-dev
fi
- echo "PROJSOURCE is $PROJSOURCE"
# Download external PROJ.4 version and compile
- export PROJ_DIR=/tmp/proj_dl_install
- ci/travis/proj-dl-and-compile "$PROJSOURCE"
# Download external PROJ.4 version and compile if not existing already
- export PROJ_DIR=$PROJ_BASE_DIR/proj-${PROJSOURCE:0:5}
- |
if [ "$PROJSOURCE" = "git" ] || [[ "$PROJSOURCE" != "git" && ! -d "$PROJ_DIR" ]]; then
ci/travis/proj-dl-and-compile "$PROJSOURCE"
fi
- export PROJ_LIB=$PROJ_DIR/share/proj
install:
# coverage report requires a local install
- pip install "pip>=10.0.1,<19.1"
- PYPROJ_FULL_COVERAGE=YES pip install -e .
- pip install -r requirements-dev.txt
- pip install pip>=10.0.1
- make install-dev
- pip install coveralls
script:
- python -c "import pyproj; pyproj.Proj(init='epsg:4269')"
- py.test --cov-report term-missing --cov=pyproj -v -s
- make test-coverage
# Building and uploading docs with doctr
- set -e
- |
if [ "$DOC" ]; then
bash create_docs.sh
make install-docs
make docs
pip install doctr
if [[ -z "$TRAVIS_TAG" ]]; then
DEPLOY_DIR=dev;
DEPLOY_DIR=latest;
else
DEPLOY_DIR="$TRAVIS_TAG";
fi
......@@ -99,13 +107,6 @@ script:
after_success:
- coveralls
## Build manylinux wheels & upload to Rackspace container
#- |
# if [ "$TRAVIS_OS_NAME" != "osx" ] && [ "$TRAVIS_TAG" == "$TRAVIS_BRANCH" ]; then
# docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh ${PROJSOURCE} ${TRAVIS_PYTHON_VERSION}
# pip install wheelhouse-uploader
# python -m wheelhouse_uploader upload --local-folder ${TRAVIS_BUILD_DIR}/wheelhouse/ --no-update-index wheels
# fi
notifications:
email: false
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
# Contributors Guide
Interested in helping build pyproj? Have code from your research that you believe others will find useful? Have a few minutes to tackle an issue? In this guide we will get you setup and integrated into contributing to pyproj!
## Introduction
First off, thank you for considering contributing to pyproj. pyproj is community-driven
project. It's people like you that make pyproj useful and successful. There are many ways
to contribute, from writing tutorials or examples, improvements to the documentation,
submitting bug reports and feature requests, or even writing code which can be incorporated into pyproj for everyone to use.
Following these guidelines helps to communicate that you respect the time of the
developers managing and developing this open source project. In return, they
should reciprocate that respect in addressing your issue, assessing changes, and
helping you finalize your pull requests.
So, please take a few minutes to read through this guide and get setup for success with your pyproj contributions. We're glad you're here!
## What Can I Do?
* Tackle any [issues](https://github.com/pyproj4/pyproj/issues) you wish! We have a special
label for issues that beginners might want to try. Have a look at our
[current beginner issues.](https://github.com/pyproj4/pyproj/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Beginner%22)
Also have a look at if the issue is already assigned to someone - this helps us make sure that work is not duplicated if the issue is already being worked on by someone else.
* Contribute code you already have. It does not need to be perfect! We will help you clean
things up, test it, etc.
* Make a tutorial or example of how to do something.
* Improve documentation of a feature you found troublesome.
* File a new issue if you run into problems!
## Ground Rules
The goal is to maintain a diverse community that's pleasant for everyone. Please
be considerate and respectful of others by following our
[code of conduct](https://github.com/pyproj4/pyproj/blob/master/CODE_OF_CONDUCT.md).
Other items:
* Each pull request should consist of a logical collection of changes. You can
include multiple bug fixes in a single pull request, but they should be related.
For unrelated changes, please submit multiple pull requests.
* Do not commit changes to files that are irrelevant to your feature or bugfix
(eg: .gitignore).
* Be willing to accept criticism and work on improving your code; we don't want
to break other users' code, so care must be taken not to introduce bugs.
* Be aware that the pull request review process is not immediate, and is
generally proportional to the size of the pull request.
## Reporting a bug
The easiest way to get involved is to report issues you encounter when using pyproj or by
requesting something you think is missing.
* Head over to the [issues](https://github.com/pyproj4/pyproj/issues) page.
* Search to see if your issue already exists or has even been solved previously.
* If you indeed have a new issue or request, click the "New Issue" button.
* Fill in as much of the issue template as is relevant. Please be as specific as possible.
Include the version of the code you were using, as well as what operating system you
are running. If possible, include complete, minimal example code that reproduces the problem.
## Setting up your development environment
We recommend using the [conda](https://conda.io/docs/) package manager for your Python
environments. Our recommended setup for contributing is:
* Install [miniconda](https://docs.conda.io/en/latest/miniconda.html) on your system.
* Install git on your system if it is not already there (install XCode command line tools on
a Mac or git bash on Windows)
* Login to your GitHub account and make a fork of the
[pyproj repository](https://github.com/pyproj4/pyproj/) by clicking the "Fork" button.
* Clone your fork of the pyproj repository (in terminal on Mac/Linux or git shell/
GUI on Windows) in the location you'd like to keep it. We are partial to creating a
``git_repos`` directory in our home folder.
``git clone https://github.com/your-user-name/pyproj.git``
* Navigate to that folder in the terminal or in Anaconda Prompt if you're on Windows.
``cd pyproj``
* Connect your repository to the upstream (main project).
``git remote add upstream https://github.com/pyproj4/pyproj.git``
* Create the development environment by running ``conda create -n devel -c conda-forge python proj4``.
* Activate our new development environment ``conda activate devel`` on Mac/Linux or
``activate devel`` on Windows.
* Make an editable install of pyproj by running ``pip install -e .``
Now you're all set! You have an environment called ``devel`` that you can work in. You'll need
to make sure to activate that environment next time you want to use it after closing the
terminal or your system. If you want to get back to the root environment, just run
``source deactivate`` (just ``deactivate`` on Windows).
## Pull Requests
The changes to the pyproj source (and documentation) should be made via GitHub pull requests against ``master``, even for those with administration rights. While it's tempting to make changes directly to ``master`` and push them up, it is better to make a pull request so that others can give feedback. If nothing else, this gives a chance for the automated tests to run on the PR. This can eliminate "brown paper bag" moments with buggy commits on the master branch.
During the Pull Request process, before the final merge, it's a good idea to rebase the branch and squash together smaller commits. It's not necessary to flatten the entire branch, but it can be nice to eliminate small fixes and get the merge down to logically arranged commits. This can also be used to hide sins from history--this is the only chance, since once it hits ``master``, it's there forever!
**Working on your first Pull Request?** You can learn how from this *free* video series
[How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github), Aaron Meurer's [tutorial on the git workflow](https://www.asmeurer.com/git-workflow/), or the guide [“How to Contribute to Open Source"](https://opensource.guide/how-to-contribute/).
Commit the changes you made. Chris Beams has written a [guide](https://chris.beams.io/posts/git-commit/) on how to write good commit messages.
Push to your fork and [submit a pull request]( https://github.com/pyproj4/pyproj/compare/).
## Documentation
Now that you've made your awesome contribution, it's time to tell the world how to use it.
Writing documentation strings is really important to make sure others use your functionality properly. Didn't write new functions? That's fine, but be sure that the documentation for the code you touched is still in great shape. It is not uncommon to find some strange wording or clarification that you can take care of while you are here. If you added a new function make sure that it gets marked as included if appropriate in the GEMPAK conversion table.
You can write examples in the documentation if they are simple concepts to demonstrate. If
your feature is more complex, consider adding to the examples or tutorials for pyproj.
You can build the documentation locally to see how your changes will look.
* Install docs requirements: ``make install-docs``
* Build the docs: ``make docs``
* Or, to build and open in a browser: ``make docs-browser``
## Tests
Unit tests are the lifeblood of the project, as it ensures that we can continue to add and
change the code and stay confident that things have not broken. Running the tests requires
``pytest``, which is easily available through ``conda`` or ``pip``. It was also installed if you made our default ``devel`` environment.
### Running Tests
Running the tests can be done by running ``py.test``
Running the whole test suite isn't that slow, but can be a burden if you're working on just
one module or a specific test. It is easy to run tests on a single directory:
py.test pyproj/calc
A specific test can be run as:
py.test -k test_my_test_func_name
### Writing Tests
Tests should ideally hit all of the lines of code added or changed. We have automated
services that can help track down lines of code that are missed by tests. Watching the
coverage has even helped find sections of dead code that could be removed!
Let's say we are adding a simple function to add two numbers and return the result as a float or as a string. (This would be a silly function, but go with us here for demonstration purposes.)
def add_as_float_or_string(a, b, as_string=False):
res = a + b
if as_string:
return string(res)
return res
I can see two easy tests here: one for the results as a float and one for the results as a
string. If I had added this to the ``calc`` module, I'd add those two tests in
``tests/test_calc.py``.
def test_add_as_float_or_string_defaults():
res = add_as_float_or_string(3, 4)
assert(res, 7)
def test_add_as_float_or_string_string_return():
res = add_as_float_or_string(3, 4, as_string=True)
assert(res, '7')
There are plenty of more advanced testing concepts, like dealing with floating point
comparisons, parameterizing tests, testing that exceptions are raised, and more. Have a look at the existing tests to get an idea of some of the common patterns.
## Code Style
pyproj uses the Python code style outlined in [PEP8](https://pep8.org) and [black](https://github.com/python/black).
We enforce this style as code is added to keep everything clean and uniform. To this end, part of the automated testing for pyproj checks style. To check style
locally within the source directory you can use the ``flake8`` and ``black`` tools. Running it from the root of the source directory is as easy as running ``make lint`` in the base of the repository.
You can also just submit your PR and the kind robots will comment on all style violations as well. It can be a pain to make sure you have the right number of spaces around things, imports in order, and all of the other nits that the bots will find. It is very important though as this consistent style helps us keep pyproj readable, maintainable, and uniform.
## What happens after the pull request
You've make your changes, documented them, added some tests, and submitted a pull request.
What now?
### Automated Testing
First, our army of never sleeping robots will begin a series of automated checks.
The test suite, documentation, style, and more will be checked on various versions of Python with current and legacy packages. Travis CI will run testing on Linux and Mac, Appveyor will run tests on Windows. Other services will kick in and check if there is a drop in code coverage or any style variations that should be corrected. If you see a red mark by a service, something failed and clicking the "Details" link will give you more information. We're happy to help if you are stuck.
The robots can be difficult to satisfy, but they are there to help everyone write better code. In some cases, there will be exceptions to their suggestions, but these are rare. If you make changes to your code and push again, the tests will automatically run again.
### Code Review
At this point you're waiting on us. You should expect to hear at least a comment within a
couple of days. We may suggest some changes or improvements or alternatives.
Some things that will increase the chance that your pull request is accepted quickly:
* Write tests.
* Follow [PEP8][https://pep8.org] for style. (The `flake8` utility can help with this.)
* Use [black](https://github.com/python/black)
* Write a [good commit message][https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html].
Pull requests will automatically have tests run by Travis. This includes
running both the unit tests as well as the `flake8` code linter.
### Merging
Once we're all happy with the pull request, it's time for it to get merged in. Only the
maintainers can merge pull requests and you should never merge a pull request you have commits on as it circumvents the code review. If this is your first or second pull request, we'll likely help by rebasing and cleaning up the commit history for you. As your developement skills increase, we'll help you learn how to do this.
## More Questions?
If you're stuck somewhere or are interested in being a part of the community in
other ways, feel free to contact us:
* [pyproj's Gitter Channel](https://gitter.im/pyproj4-pyproj/community)
* ["pyproj" tag on GIS Stack Exchange](https://gis.stackexchange.com/questions/tagged/pyproj)
## Futher Reading
There are a ton of great resources out there on contributing to open source and on the
importance of writing tested and maintainable software.
* [GitHub's Contributing to Open Source Guide](https://guides.github.com/activities/contributing-to-open-source/)
* [Zen of Scientific Software Maintenance](https://jrleeman.github.io/ScientificSoftwareMaintenance/)
......@@ -2,7 +2,7 @@ include README.md
include MANIFEST.in
include pyproject.toml
include LICENSE
include create_docs.sh
include Makefile
include pyproj/*.pyd
include pyproj/*.pyx
include pyproj/*.pxd
......
# This was based on a Makefile by Kirk Hansen <https://github.com/kirkhansen>
.PHONY: clean clean-test clean-pyc clean-build clean-setup clean-cython docs help test
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
BROWSER := python3 -c "$$BROWSER_PYSCRIPT"
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
clean: clean-build clean-pyc clean-test clean-setup clean-cython ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
clean-setup: ## run python setup.py clean
python setup.py clean
clean-cython: ## clean the cython files
rm -f pyproj/*.so
rm -f pyproj/*.c
lint: ## check style with flake8
flake8 --max-line-length 88 setup.py pyproj/ test/ docs/
check: lint ## flake8 black isort check
black --check setup.py pyproj/ test/ docs/
isort --recursive -m 3 -w 88 -tc -p test setup.py pyproj/ test/ docs/
isort: ## order imports
isort --recursive -m 3 -w 88 -tc -p test setup.py pyproj/ test/ docs/
black: ## black format files
black setup.py pyproj/ test/ docs/
test: ## run tests
py.test
test-verbose: ## run tests with full verbosity
py.test -vv -s
test-coverage: ## run tests and generate coverage report
py.test --cov-report term-missing --cov=pyproj -v -s
install-docs: ## Install requirements for building documentation
pip install sphinx sphinx_rtd_theme
docs: ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs clean
$(MAKE) -C docs html
docs-browser: docs ## generate Sphinx HTML documentation, including API docs and open in a browser
$(BROWSER) docs/_build/html/index.html
install: clean ## install the package to the active Python's site-packages
python setup.py install
install-dev: clean ## install development version to active Python's site-packages
pip install -U -r requirements-dev.txt
PYPROJ_FULL_COVERAGE=YES pip install -e . --no-use-pep517 || PYPROJ_FULL_COVERAGE=YES pip install -e .
......@@ -2,22 +2,26 @@
Python interface to [PROJ](http://proj.org) (cartographic projections and coordinate transformations library).
[![Join the chat at https://gitter.im/pyproj4-pyproj/community](https://badges.gitter.im/pyproj4-pyproj/community.svg)](https://gitter.im/pyproj4-pyproj/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/pyproj4/pyproj.svg)](https://travis-ci.org/pyproj4/pyproj)
[![Build status](https://ci.appveyor.com/api/projects/status/8xkka4s97uwhkc64/branch/master?svg=true
)](https://ci.appveyor.com/project/jswhit/pyproj)
[![Coverage Status](https://coveralls.io/repos/github/pyproj4/pyproj/badge.svg?branch=master)](https://coveralls.io/github/pyproj4/pyproj?branch=master)
[![PyPI version](https://badge.fury.io/py/pyproj.svg)](https://badge.fury.io/py/pyproj)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pyproj/badges/version.svg)](https://anaconda.org/conda-forge/pyproj)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2592232.svg)](https://doi.org/10.5281/zenodo.2592232)
<p align="center">
<a href="https://gitter.im/pyproj4-pyproj/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img alt="Join the chat at https://gitter.im/pyproj4-pyproj/community" src="https://badges.gitter.im/pyproj4-pyproj/community.svg"></a>
<a href="https://travis-ci.org/pyproj4/pyproj"><img alt="Build Status" src="https://travis-ci.org/pyproj4/pyproj.svg"></a>
<a href="https://ci.appveyor.com/project/jswhit/pyproj"><img alt="Build Status" src="https://ci.appveyor.com/api/projects/status/8xkka4s97uwhkc64/branch/master?svg=true"></a>
<a href="https://coveralls.io/github/pyproj4/pyproj?branch=master"><img alt="Coverage Status" src="https://coveralls.io/repos/github/pyproj4/pyproj/badge.svg?branch=master"></a>
<a href="https://badge.fury.io/py/pyproj"><img alt="PyPI" src="https://badge.fury.io/py/pyproj.svg"></a>
<a href="https://pepy.tech/project/pyproj"><img alt="Downloads" src="https://pepy.tech/badge/pyproj"></a>
<a href="https://anaconda.org/conda-forge/pyproj"><img alt="Anaconda-Server Badge" src="https://anaconda.org/conda-forge/pyproj/badges/version.svg"></a>
<a href="https://github.com/python/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://zenodo.org/badge/latestdoi/28607354"><img alt="DOI" src="https://zenodo.org/badge/28607354.svg"></a>
</p>
## Documentation
- Stable: http://pyproj4.github.io/pyproj
- Latest: https://pyproj4.github.io/pyproj/dev
- Stable: http://pyproj4.github.io/pyproj/stable/
- Latest: https://pyproj4.github.io/pyproj/latest/
## Bugs/Questions
- Report bugs at: https://github.com/pyproj4/pyproj/issues
- Ask questions at: https://gitter.im/pyproj4-pyproj/community
\ No newline at end of file
- Report bugs/ask questions: https://github.com/pyproj4/pyproj/issues
- Ask developer questions: https://gitter.im/pyproj4-pyproj/community
- Ask the community: https://gis.stackexchange.com/questions/tagged/pyproj
......@@ -9,6 +9,7 @@ environment:
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\appveyor\\run_with_env.cmd"
PROJ_BASE_DIR: "%APPVEYOR_BUILD_FOLDER%\\proj_install"
matrix:
# Pre-installed Python versions
......@@ -47,9 +48,11 @@ shallow_clone: true
cache:
- C:\Users\appveyor\AppData\Local\pip\Cache\wheels
- "%PROJ_BASE_DIR%"
build_script:
# setup sqlite3
- set PROJ_DIR=%PROJ_BASE_DIR%\proj-%PROJSOURCE:~0,5%
- vcpkg install sqlite3:"%platform%"-windows
- set SQLITE3_BIN=%APPVEYOR_BUILD_FOLDER%\sqlite3\bin
- mkdir %SQLITE3_BIN%
......@@ -61,26 +64,28 @@ build_script:
- set PATH=%PATH%;%SQLITE3_BIN%
# setup PROJ.4
- if "%PROJSOURCE%" == "git" git clone https://github.com/OSGeo/proj.4.git proj-git
- if not "%PROJSOURCE%" == "git" curl -o "proj-%PROJSOURCE:~0,5%.zip" "https://download.osgeo.org/proj/proj-%PROJSOURCE%.zip"
- if not "%PROJSOURCE%" == "git" 7z x -aoa -y "proj-%PROJSOURCE:~0,5%.zip"
- cd "%APPVEYOR_BUILD_FOLDER%\proj-%PROJSOURCE:~0,5%"
- if not "%PROJSOURCE%" == "git" if not exist %PROJ_DIR% set BUILD_PROJ_STABLE=1
- if defined BUILD_PROJ_STABLE curl -o "proj-%PROJSOURCE:~0,5%.zip" "https://download.osgeo.org/proj/proj-%PROJSOURCE%.zip"
- if defined BUILD_PROJ_STABLE 7z x -aoa -y "proj-%PROJSOURCE:~0,5%.zip"
- if not exist %PROJ_DIR% cd "%APPVEYOR_BUILD_FOLDER%\proj-%PROJSOURCE:~0,5%"
- if "%platform%" == "x64" SET VS_FULL=%VS_VERSION% Win64
- if "%platform%" == "x64" SET BUILD_LIBPROJ_SHARED=ON
- if "%platform%" == "x86" SET VS_FULL=%VS_VERSION%
- if "%platform%" == "x86" SET BUILD_LIBPROJ_SHARED=OFF
- echo "%VS_FULL%"
#
- mkdir build
- cd build
- set PROJ_DIR=%APPVEYOR_BUILD_FOLDER%\proj_dir
- cmake -G "%VS_FULL%" .. -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBPROJ_SHARED="%BUILD_LIBPROJ_SHARED%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
- cmake --build . --config Release --target install
- if "%PROJSOURCE%" == "git" set BUILD_PROJ=1
- if defined BUILD_PROJ_STABLE set BUILD_PROJ=1
- if defined BUILD_PROJ mkdir build
- if defined BUILD_PROJ cd build
- if defined BUILD_PROJ cmake -G "%VS_FULL%" .. -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBPROJ_SHARED="%BUILD_LIBPROJ_SHARED%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
- if defined BUILD_PROJ cmake --build . --config Release --target install
- set PATH=%PATH%;%PROJ_DIR%\bin
- set PROJ_LIB=%PROJ_DIR%\share\proj
- cd %PROJ_LIB%
- curl -O http://download.osgeo.org/proj/proj-datumgrid-1.8.zip
- 7z e -aoa -y proj-datumgrid-1.8.zip
- del proj-datumgrid-1.8.zip
- if defined BUILD_PROJ cd %PROJ_LIB%
- if defined BUILD_PROJ curl -O http://download.osgeo.org/proj/proj-datumgrid-1.8.zip
- if defined BUILD_PROJ 7z e -aoa -y proj-datumgrid-1.8.zip
- if defined BUILD_PROJ del proj-datumgrid-1.8.zip
- cd %APPVEYOR_BUILD_FOLDER%
- proj
# Build and install pyproj
......
#!/bin/bash
pip install sphinx sphinx_rtd_theme
cd docs && make html && cd ..
python-pyproj (2.2.1+ds-1~exp1) experimental; urgency=medium
* New upstream release.
* Ignore test failures on armhf.
-- Bas Couwenberg <sebastic@debian.org> Fri, 21 Jun 2019 06:39:48 +0200
python-pyproj (2.2.0+ds-1~exp1) experimental; urgency=medium
* New upstream release.
......
......@@ -24,7 +24,7 @@ include /usr/share/dpkg/architecture.mk
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifneq (,$(filter $(DEB_BUILD_ARCH),i386 hppa hurd-i386 kfreebsd-i386 powerpc))
ifneq (,$(filter $(DEB_BUILD_ARCH),armhf i386 hppa hurd-i386 kfreebsd-i386 powerpc))
dh_auto_test || echo "Ignoring test failures"
else
dh_auto_test
......
......@@ -47,7 +47,7 @@ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """
__version__ = "2.2.0"
__version__ = "2.2.1"
__all__ = [
"Proj",
"Geod",
......@@ -62,21 +62,23 @@ __all__ = [
"get_prime_meridians_map",
"get_proj_operations_map",
"get_units_map",
"show_versions",
]
import sys
from pyproj._list import ( # noqa
from pyproj._list import ( # noqa: F401
get_angular_units_map,
get_ellps_map,
get_prime_meridians_map,
get_proj_operations_map,
get_units_map,
)
from pyproj.crs import CRS # noqa
from pyproj.exceptions import ProjError # noqa
from pyproj.geod import Geod, geodesic_version_str, pj_ellps # noqa
from pyproj.proj import Proj, pj_list, proj_version_str # noqa
from pyproj.transformer import Transformer, itransform, transform # noqa
from pyproj._show_versions import show_versions # noqa: F401
from pyproj.crs import CRS # noqa: F401
from pyproj.exceptions import ProjError # noqa: F401
from pyproj.geod import Geod, geodesic_version_str, pj_ellps # noqa: F401
from pyproj.proj import Proj, pj_list, proj_version_str # noqa: F401
from pyproj.transformer import Transformer, itransform, transform # noqa: F401
def test(**kwargs):
......
......@@ -5,5 +5,5 @@ cdef class Proj:
cdef PJ_CONTEXT * projctx
cdef PJ_PROJ_INFO projpj_info
cdef char *pjinitstring
cdef public object proj_version
cdef object _proj_version
include "base.pxi"
import warnings
from pyproj.compat import cstrencode, pystrdecode
from pyproj._datadir cimport get_pyproj_context
from pyproj.exceptions import ProjError
......@@ -26,7 +28,7 @@ cdef class Proj:
if self.projpj is NULL:
raise ProjError("Invalid projection {}.".format(projstring))
self.projpj_info = proj_pj_info(self.projpj)
self.proj_version = PROJ_VERSION_MAJOR
self._proj_version = PROJ_VERSION_MAJOR
def __dealloc__(self):
"""destroy projection definition"""
......@@ -35,6 +37,14 @@ cdef class Proj:
if self.projctx is not NULL:
proj_context_destroy(self.projctx)
@property
def proj_version(self):
warnings.warn(
"'Proj.proj_version' is deprecated. "
"Please use `pyproj.proj_version_str` instead."
)
return self._proj_version
@property
def definition(self):
return self.projpj_info.definition
......
"""
Utility methods to print system info for debugging
adapted from :func:`sklearn.utils._show_versions`
which was adapted from :func:`pandas.show_versions`
"""
import importlib
import platform
import sys
def _get_sys_info():
"""System information
Return
------
sys_info : dict
system and Python version information
"""
blob = [
("python", sys.version.replace("\n", " ")),
("executable", sys.executable),
("machine", platform.platform()),
]
return dict(blob)
def _get_proj_info():
"""Information on system PROJ
Returns
-------
proj_info: dict
system PROJ information
"""
import pyproj
from pyproj.exceptions import DataDirError
try:
data_dir = pyproj.datadir.get_data_dir()
except DataDirError:
data_dir = None
blob = [("PROJ", pyproj.proj_version_str), ("data dir", data_dir)]
return dict(blob)
def _get_deps_info():
"""Overview of the installed version of main dependencies
Returns
-------
deps_info: dict
version information on relevant Python libraries
"""
deps = ["pyproj", "pip", "setuptools", "Cython", "aenum"]
def get_version(module):
try:
return module.__version__
except AttributeError:
return module.version
deps_info = {}
for modname in deps:
try:
if modname in sys.modules:
mod = sys.modules[modname]
else:
mod = importlib.import_module(modname)
ver = get_version(mod)
deps_info[modname] = ver
except ImportError:
deps_info[modname] = None
return deps_info
def _print_info_dict(info_dict):
"""Print the information dictionary"""
for key, stat in info_dict.items():
print("{key:>10}: {stat}".format(key=key, stat=stat))
def show_versions():
"""Print useful debugging information
Example
-------
> python -c "import pyproj; pyproj.show_versions()"
"""
print("\nSystem:")
_print_info_dict(_get_sys_info())
print("\nPROJ:")
_print_info_dict(_get_proj_info())
print("\nPython deps:")
_print_info_dict(_get_deps_info())