Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove future from setup.py and _setup commands #785

Merged
merged 10 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ commands:
paths:
- << parameters.condaenv >>

install_pip_packages:
description: "Check pip installation"

parameters:
packages:
type: string
default: "python"

steps:
- checkout

- attach_workspace:
at: ~/project

- run:
name: Install with Pip
command: |
conda create -v --quiet --name pipenv --show-channel-urls --channel conda-forge << parameters.packages >>
source activate pipenv
pip install -e .

jobs:
conda2_env:
<<: *defaults2
Expand All @@ -230,6 +251,13 @@ jobs:
packages: "python=3.6 fipy"
condaenv: "test-environment-36"

pip_env:
<<: *defaults3

steps:
- install_pip_packages:
packages: "python=3"

test-27-pysparse:
<<: *defaults2

Expand Down Expand Up @@ -565,6 +593,7 @@ workflows:
# - build-27-docs:
# requires:
# - conda2_env
- pip_env
- build-36-docs:
requires:
- conda3_env
Expand Down
13 changes: 0 additions & 13 deletions _setup/_nativize.py

This file was deleted.

7 changes: 1 addition & 6 deletions _setup/build_docs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from __future__ import unicode_literals
from distutils.core import Command
import os
from future.utils import text_to_native_str

from ._nativize import nativize_all

__all__ = [text_to_native_str("build_docs")]
__all__ = ["build_docs"]

class build_docs(Command):

Expand All @@ -17,7 +13,6 @@ class build_docs(Command):
('html', None, "compile the HTML variant of the documentation"),
('cathartic', None, "rewrite all the files (default is to only rewrite changed files)"),
]
user_options = [nativize_all(u) for u in user_options]

def initialize_options (self):
self.pdf = 0
Expand Down
7 changes: 1 addition & 6 deletions _setup/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
Adapted from: https://gist.github.com/patrickfuller/e2ea8a94badc5b6967ef3ca0a9452a43
"""
from __future__ import print_function
from __future__ import unicode_literals

import os
import textwrap
from distutils.core import Command
from future.utils import text_to_native_str

from ._nativize import nativize_all

__all__ = [text_to_native_str("changelog")]
__all__ = ["changelog"]

class changelog(Command):
description = "Generate ReST change log from github issues and pull requests"
Expand Down Expand Up @@ -43,7 +39,6 @@ class changelog(Command):
"If the string `none` is passed, "
"issues without milestones are returned. ")
]
user_options = [nativize_all(u) for u in user_options]

def initialize_options(self):
import github
Expand Down
9 changes: 2 additions & 7 deletions _setup/copy_script.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from __future__ import print_function
from __future__ import unicode_literals
from builtins import input
import os
from distutils.core import Command
from future.utils import text_to_native_str

from ._nativize import nativize_all

__all__ = [text_to_native_str("copy_script")]
__all__ = ["copy_script"]

class copy_script(Command):
description = "copy an example script into a new editable file"
Expand All @@ -21,7 +16,6 @@ class copy_script(Command):
('To=', None,
"path and file name to save script to")
]
user_options = [nativize_all(u) for u in user_options]

def initialize_options(self):
self.From = None
Expand All @@ -44,6 +38,7 @@ def finalize_options(self):
ans = 'no'

if ("no".find(ans.lower()) is 0):
from builtins import input
self.To = input("Please give a name for the ouput file: ")
self.finalize_options()

Expand Down
9 changes: 2 additions & 7 deletions _setup/release.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
"""setuptools command to prepare FiPy for release"""
from __future__ import unicode_literals

from distutils.core import Command
import glob
import os
import shutil

from setuptools.sandbox import run_setup
from future.utils import text_to_native_str

from ._nativize import nativize_all

__all__ = [text_to_native_str("release")]
__all__ = ["release"]


class release(Command):
Expand All @@ -27,7 +23,6 @@ class release(Command):
('windows', None, "create an executable installer for MS Windows"),
('all', None, "create unix and Windows distributions"),
]
user_options = [nativize_all(u) for u in user_options]

def initialize_options(self):
self.unix = 0
Expand Down Expand Up @@ -72,7 +67,7 @@ def _build_windows_distribution(self):
self._remove_manifest()

shutil.copyfile("MANIFEST-WINDOWS.in", "MANIFEST.in")
run_setup("setup.py", [text_to_native_str(s) for s in ["sdist", "--dist-dir=dist-windows", "--formats=zip"]])
run_setup("setup.py", ["sdist", "--dist-dir=dist-windows", "--formats=zip"])
shutil.move(
os.path.join("dist-windows", "FiPy-{}.zip".format(version)),
os.path.join("dist", "FiPy-{}.win32.zip".format(version)),
Expand Down
7 changes: 1 addition & 6 deletions _setup/upload_products.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from __future__ import print_function
from __future__ import unicode_literals
from distutils.core import Command
import os
from future.utils import text_to_native_str

from ._nativize import nativize_all

__all__ = [text_to_native_str("upload_products")]
__all__ = ["upload_products"]

class upload_products(Command):
description = "upload FiPy compressed archives to website(s)"
Expand All @@ -16,7 +12,6 @@ class upload_products(Command):
('tarball', None, "upload the .tar.gz source distribution"),
('winzip', None, "upload the .win32.zip distribution"),
]
user_options = [nativize_all(u) for u in user_options]

def initialize_options (self):
self.pdf = 0
Expand Down
6 changes: 4 additions & 2 deletions documentation/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,10 @@ command in the base directory::

This mechanism is intended primarily for the developers. At a minimum,
you will need at least version 1.7.0 of `Sphinx
<http://www.sphinx-doc.org/>`_, plus all of its prerequisites. We
install via conda::
<http://www.sphinx-doc.org/>`_, plus all of its prerequisites. Python
2.7 probably won't work.

We install via conda::

$ conda install --channel conda-forge sphinx

Expand Down