Skip to content

Commit

Permalink
Merge 4a4a69f into 4e7c620
Browse files Browse the repository at this point in the history
  • Loading branch information
aburrell authored Apr 21, 2021
2 parents 4e7c620 + 4a4a69f commit 1243d46
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 118 deletions.
21 changes: 11 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ assignees: ''

---

**Describe the bug**
# Describe the bug
A clear and concise description of what the bug is.

**To Reproduce**
## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
## Expected behavior
A clear and concise description of what you expected to happen.

**Screenshots**
## Screenshots
If applicable, add screenshots to help explain your problem.

**Computer (please complete the following information):**
- OS: [e.g. iOS]
- Python version [e.g. 3.6]
- Compiler with version [e.g., gfortran 47]
- Apexpy version/branch [e.g., 1.1.0]
## Computer
Please provide the following information:
* OS: (e.g. iOS)
* Python version: (e.g. 3.6)
* Compiler with version: (e.g., gfortran 47)
* Apexpy version/branch: (e.g., 1.1.0/main)

**Additional context**
## Additional context
Add any other context about the problem here.
21 changes: 13 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ labels: 'enhancement'
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]
# Requested feature
A short description of what you are proposing.

**Describe the solution you'd like**
## The problem or gap this feature will address
A clear and concise description of what the problem is. For example, I'm always
frustrated when ...

## The desired solution
A clear and concise description of what you want to happen. Keep the scope as
narrow as possible, to make it easier to implement

**Describe alternatives you've considered**
## Possible alternatives
A clear and concise description of any alternative solutions or features you've
considered.

**Additional context**
Add any other context or screenshots about the feature request here. For context, the apexpy version/branch you're working on, your system detail, your python version, and your compiler (with version) may or may not be relevant.
## Additional context
Add any other context or screenshots about the feature request here. For
context, the apexpy version/branch you're working on, your system detail, your
python version, and your compiler (with version) may or may not be relevant.

**Reminders**
## Reminders
This is a volunteer-driven project. Code contributions are welcome, as is help
testing new code.
21 changes: 11 additions & 10 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ assignees: ''

---

**Describe the problem or ask the question**
# Describe the problem or ask the question
A clear and concise description of what the problem or question is.

**Provide an example, if applicable**
## Provide an example, if applicable
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See behaviour

**Expectations**
## Expectations
A clear and concise description of what you expected (or wanted) to happen.

**Screenshots**
## Screenshots
If applicable, add screenshots to help explain your question.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Python version [e.g. 3.6]
- Compiler with version [e.g., gfortran 22]
- Apexpy version/branch [e.g., 1.1.0]
## Desktop
Please complete the following information:
* OS: (e.g., iOS)
* Python version: (e.g., 3.6)
* Compiler with version: (e.g., gfortran 22)
* Apexpy version/branch: (e.g., 1.1.0/main)

**Additional context**
## Additional context
Add any other context about the problem here.
13 changes: 6 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Please delete options that are not relevant.

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality
to not work as expected)
- Breaking change (fix or feature that changes existing functionality)
- This change requires a documentation update
- Release candidate

Expand All @@ -26,11 +25,11 @@ your test configuration
- Test A
- Test B

**Test Configuration**:
* Operating system: (e.g., Hal)
* Python version number: (e.g., 3.7)
* Compiler with version number: (e.g. gfortran 9.0)
* Any details about your local setup that are relevant (e.g., apexpy version/branch)
## Test Configuration:
- Operating system: (e.g., Hal)
- Python version number: (e.g., 3.7)
- Compiler with version number: (e.g. gfortran 9.0)
- Relevant llocal setup details: (e.g., apexpy version/branch)

# Checklist:

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog
------------------
* Removed Python 2 support
* Updated community and package documentation
* Updated unit test style to reduce duplication and better follow PEP8
* Updated code style using codacy suggestions

1.1.0 (2021-03-05)
------------------
Expand Down
26 changes: 14 additions & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
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.
size, disability, ethnicity, sex characteristics, gender identity and
expression, level of experience, education, socio-economic status, nationality,
persona appearance, race, religion, or sexual identity and orientation.

## Our Standards

Expand All @@ -23,13 +23,13 @@ include:
Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
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
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
professional setting

## Our Responsibilities

Expand Down Expand Up @@ -58,19 +58,21 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at angeline.burrell@nrl.navy.mil. 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.
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
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

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

[homepage]: https://www.contributor-covenant.org
41 changes: 27 additions & 14 deletions ci/appveyor-bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""
AppVeyor will at least have few Pythons around so there's no point of implementing a bootstrapper in PowerShell.
AppVeyor will at least have few Pythons around so there's no point of
implementing a bootstrapper in PowerShell.
This is a port of https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1
with various fixes and improvements that just weren't feasible to implement in PowerShell.
This is a port of https://github.com/pypa/python-packaging-user-guide/blob/
master/source/code/install.ps1 with various fixes and improvements that just
weren't feasible to implement in PowerShell.
"""
from __future__ import print_function

from os import environ
from os.path import exists
from subprocess import check_call
Expand All @@ -16,30 +18,38 @@

BASE_URL = "https://www.python.org/ftp/python/"
GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
GET_PIP_PATH = "C:\get-pip.py"
GET_PIP_PATH = r"C:\get-pip.py"

# These URLS No longer seem to be needed, but are kept here for reference
# NOTE: no .msi installer for 3.3.6
URLS = {
("2.6", "64"): BASE_URL + "2.6.6/python-2.6.6.amd64.msi",
("2.6", "32"): BASE_URL + "2.6.6/python-2.6.6.msi",
("2.7", "64"): BASE_URL + "2.7.10/python-2.7.10.amd64.msi",
("2.7", "32"): BASE_URL + "2.7.10/python-2.7.10.msi",
# NOTE: no .msi installer for 3.3.6
("3.3", "64"): BASE_URL + "3.3.3/python-3.3.3.amd64.msi",
("3.3", "32"): BASE_URL + "3.3.3/python-3.3.3.msi",
("3.4", "64"): BASE_URL + "3.4.3/python-3.4.3.amd64.msi",
("3.4", "32"): BASE_URL + "3.4.3/python-3.4.3.msi",
("3.5", "64"): BASE_URL + "3.5.0/python-3.5.0-amd64.exe",
("3.5", "32"): BASE_URL + "3.5.0/python-3.5.0.exe",
}

# Commands are allowed to fail only if they are not the last command.
# E.G., uninstall (/x) allowed to fail.
INSTALL_CMD = {
# Commands are allowed to fail only if they are not the last command. Eg: uninstall (/x) allowed to fail.
"2.6": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}",
"TARGETDIR={home}"]],
"2.7": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}",
"TARGETDIR={home}"]],
"3.3": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}",
"TARGETDIR={home}"]],
"3.4": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]],
["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}",
"TARGETDIR={home}"]],
"3.5": [["{path}", "/quiet", "TargetDir={home}"]],
}

Expand All @@ -59,7 +69,8 @@ def report(count, size, total):


def install_python(version, arch, home):
print("Installing Python", version, "for", arch, "bit architecture to", home)
print("Installing Python", version, "for", arch,
"bit architecture to", home)
if exists(home):
return

Expand Down Expand Up @@ -112,6 +123,8 @@ def install_packages(home, *packages):


if __name__ == "__main__":
install_python(environ['PYTHON_VERSION'], environ['PYTHON_ARCH'], environ['PYTHON_HOME'])
install_python(environ['PYTHON_VERSION'], environ['PYTHON_ARCH'],
environ['PYTHON_HOME'])
install_pip(environ['PYTHON_HOME'])
install_packages(environ['PYTHON_HOME'], "setuptools>=18.0.1", "wheel", "tox", "virtualenv>=13.1.0")
install_packages(environ['PYTHON_HOME'], "setuptools>=18.0.1", "wheel",
"tox", "virtualenv>=13.1.0")
70 changes: 39 additions & 31 deletions ci/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,64 +1,72 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

import os
import subprocess
import sys
from os.path import exists
from os.path import join
from os.path import dirname
from os.path import abspath


if __name__ == "__main__":
base_path = dirname(dirname(abspath(__file__)))
str_to_bool = {"false": False, "true": True}

base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
print("Project path: {0}".format(base_path))
env_path = join(base_path, ".tox", "bootstrap")

env_path = os.path.join(base_path, ".tox", "bootstrap")
if sys.platform == "win32":
bin_path = join(env_path, "Scripts")
bin_path = os.path.join(env_path, "Scripts")
else:
bin_path = join(env_path, "bin")
if not exists(env_path):
import subprocess
bin_path = os.path.join(env_path, "bin")

if not os.path.exists(env_path):
print("Making bootstrap env in: {0} ...".format(env_path))
try:
subprocess.check_call(["virtualenv", env_path])
except Exception:
subprocess.check_call([sys.executable, "-m", "virtualenv", env_path])
subprocess.check_call([sys.executable, "-m", "virtualenv",
env_path])

print("Installing `jinja2` and `matrix` into bootstrap environment ...")
subprocess.check_call([join(bin_path, "pip"), "install", "jinja2", "matrix"])
activate = join(bin_path, "activate_this.py")
exec(compile(open(activate, "rb").read(), activate, "exec"), dict(__file__=activate))
subprocess.check_call([os.path.join(bin_path, "pip"), "install",
"jinja2", "matrix"])

activate = os.path.join(bin_path, "activate_this.py")
act_dict = {__file__: activate}

# tox requires activation with exec
exec(compile(open(activate, "rb").read(), activate, "exec"), act_dict)

# Import here to ensure success, since they may have just been installed
import jinja2
import matrix

jinja = jinja2.Environment(
loader=jinja2.FileSystemLoader(join(base_path, "ci", "templates")),
trim_blocks=True,
lstrip_blocks=True,
keep_trailing_newline=True
)
loader=jinja2.FileSystemLoader(os.path.join(base_path, "ci",
"templates")),
trim_blocks=True, lstrip_blocks=True, keep_trailing_newline=True)
tox_environments = {}
for (alias, conf) in matrix.from_file(join(base_path, "setup.cfg")).items():
setup_matrix = matrix.from_file(os.path.join(base_path,
"setup.cfg")).items()
for (alias, conf) in setup_matrix:
python = conf["python_versions"]
deps = conf["dependencies"] if "dependencies" in conf.keys() else ""
if "coverage_flags" in conf:
cover = {"false": False, "true": True}[conf["coverage_flags"].lower()]
if "environment_variables" in conf:
if "coverage_flags" in conf.keys():
cover = str_to_bool[conf["coverage_flags"].lower()]
if "environment_variables" in conf.keys():
env_vars = conf["environment_variables"]

tox_environments[alias] = {
"python": "python" + python if "py" not in python else python,
"deps": deps.split(),
}
if "coverage_flags" in conf:
"deps": deps.split()}

if "coverage_flags" in conf.keys():
tox_environments[alias].update(cover=cover)
if "environment_variables" in conf:
if "environment_variables" in conf.keys():
tox_environments[alias].update(env_vars=env_vars.split())

for name in os.listdir(join("ci", "templates")):
with open(join(base_path, name), "w") as fh:
fh.write(jinja.get_template(name).render(tox_environments=tox_environments))
for name in os.listdir(os.path.join("ci", "templates")):
with open(os.path.join(base_path, name), "w") as fh:
fh.write(jinja.get_template(name).render(
tox_environments=tox_environments))
print("Wrote {}".format(name))
print("DONE.")
Loading

0 comments on commit 1243d46

Please sign in to comment.