Compare commits

...

4 commits

Author SHA1 Message Date
Justin Van Patten ad47520b86 Kill pipenv 2021-11-05 20:50:24 -07:00
Justin Van Patten 562404b15d Specify python version 2021-11-05 20:10:53 -07:00
Justin Van Patten c86b10cac5 Update Pipfile 2021-11-05 20:03:10 -07:00
Justin Van Patten 6e5719c0dc Update Pipfile 2021-11-05 19:42:15 -07:00
5 changed files with 34 additions and 37 deletions

View file

@ -87,8 +87,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pipenv
uses: dschep/install-pipenv-action@v1
- name: Setup git
run: |
git config --global user.email "you@example.com"
@ -174,8 +172,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pipenv
uses: dschep/install-pipenv-action@v1
- name: Setup git
run: |
git config --global user.email "you@example.com"

View file

@ -4,3 +4,4 @@
/env/
/*.egg-info
.venv/
venv/

View file

@ -17,14 +17,15 @@ include ../../build/common.mk
TEST_ALL_DEPS = build
ensure::
pipenv install --dev
python -m venv venv
venv/bin/python -m pip install -r requirements.txt
mkdir -p $(PYENVSRC)
build_package::
rm -rf $(PYENVSRC) && cp -R ./lib/. $(PYENVSRC)/
sed -i.bak "s/\$${VERSION}/$(PYPI_VERSION)/g" $(PYENVSRC)/setup.py && rm $(PYENVSRC)/setup.py.bak
cp ../../README.md $(PYENVSRC)
cd $(PYENVSRC) && pipenv run python setup.py build bdist_wheel --universal
cd $(PYENVSRC) && ../../venv/bin/python setup.py build bdist_wheel --universal
build_plugin::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=${VERSION}" ${LANGHOST_PKG}
@ -32,8 +33,8 @@ build_plugin::
build:: build_package build_plugin
lint::
MYPYPATH=./stubs pipenv run mypy ./lib/pulumi --config-file=mypy.ini
pipenv run pylint ./lib/pulumi --rcfile=.pylintrc
MYPYPATH=./stubs venv/bin/mypy ./lib/pulumi --config-file=mypy.ini
venv/bin/pylint ./lib/pulumi --rcfile=.pylintrc
install_package:: build_package
cp ./cmd/pulumi-language-python-exec "$(PULUMI_BIN)"
@ -48,16 +49,16 @@ install:: install_package install_plugin
test_fast:: $(TEST_ALL_DEPS)
$(GO_TEST) ${PROJECT_PKGS}
pipenv run pip install ./env/src
venv/bin/python -m pip install ./env/src
# TODO the ignored test seems to fail in pytest but not unittest. Need to trackdown why
$(RUN_TESTSUITE) python/lib/test pipenv run pytest lib/test --ignore lib/test/automation --ignore lib/test/langhost/resource_thens/test_resource_thens.py
$(RUN_TESTSUITE) python/lib/test/langhost/resource_thens pipenv run python -m unittest lib/test/langhost/resource_thens/test_resource_thens.py
PATH=venv/bin:$$PATH $(RUN_TESTSUITE) python/lib/test python -m pytest lib/test --ignore lib/test/automation --ignore lib/test/langhost/resource_thens/test_resource_thens.py
PATH=venv/bin:$$PATH $(RUN_TESTSUITE) python/lib/test/langhost/resource_thens python -m unittest lib/test/langhost/resource_thens/test_resource_thens.py
# Using python -m also adds lib/test_with_mocks to sys.path which avoids package resolution issues.
pushd lib/test_with_mocks; $(RUN_TESTSUITE) python/lib/test_with_mocks pipenv run python -m pytest; popd
pushd lib/test_with_mocks; PATH=../../venv/bin:$$PATH $(RUN_TESTSUITE) python/lib/test_with_mocks python -m pytest; popd
test_auto:: test_fast $(TEST_ALL_DEPS)
# Note that this target depends on test-fast for the call to `pipenv run pip install`
$(RUN_TESTSUITE) auto-python pipenv run pytest lib/test/automation
# Note that this target depends on test-fast for the call to `pip install`
PATH=venv/bin:$$PATH $(RUN_TESTSUITE) auto-python python -m pytest lib/test/automation
test_all:: test_fast test_auto

View file

@ -1,23 +0,0 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
# Keep this list in sync with setup.py
protobuf = ">=3.6.0"
grpcio = ">=1.33.2"
dill = ">=0.3.0"
six = ">=1.12.0"
semver = ">=2.8.1"
pyyaml = ">=5.3.1"
[dev-packages]
pylint = "==2.10.2"
mypy = ">=0.78"
pytest = "*"
pytest-timeout = "*"
types-six = "*"
types-pyyaml = "*"
types-protobuf = "*"
pytest-asyncio = "*"

View file

@ -0,0 +1,22 @@
# Keep this list in sync with setup.py:
protobuf>=3.6.0
grpcio>=1.33.2
dill>=0.3.0
six>=1.12.0
semver>=2.8.1
pyyaml>=5.3.1
# Dev packages that aren't needed by the library:
pylint==2.10.2
mypy>=0.78
pytest
pytest-timeout
types-six
types-pyyaml
types-protobuf
pytest-asyncio
urllib3>=1.26.7
chardet>=4.0.0
setuptools==57.5.0
requests>=2.26.0
wheel>=0.37.0