Skip to content

Commit

Permalink
check .tar.gz before upload to PYPI
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 22, 2024
1 parent 0914b22 commit f155ab7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 35 deletions.
4 changes: 2 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Bug tracker at https://github.com/giampaolo/pyftpdlib/issues


Version: 2.1.0 - (IN DEVELOPMENT)
=================================
Version: 2.0.1 - 2024-10-22
===========================

**Enhancements**

Expand Down
67 changes: 36 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARGS =
# In not in a virtualenv, add --user options for install commands.
SETUP_INSTALL_ARGS = `$(PYTHON) -c \
"import sys; print('' if hasattr(sys, 'real_prefix') or hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix else '--user')"`
TEST_PREFIX = PYTHONWARNINGS=always
PYTHON_ENV_VARS = PYTHONWARNINGS=always PYTHONUNBUFFERED=1
PYTEST_ARGS = -v -s --tb=short
NUM_WORKERS = `$(PYTHON) -c "import os; print(os.cpu_count() or 1)"`
PIP_INSTALL_ARGS = --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade
Expand Down Expand Up @@ -78,43 +78,47 @@ install-pydeps-dev: ## Install python deps meant for local development.
$(PYTHON) -m pip install $(PIP_INSTALL_ARGS) pip setuptools
$(PYTHON) -m pip install $(PIP_INSTALL_ARGS) `$(PYTHON) -c "import setup; print(' '.join(setup.TEST_DEPS + setup.DEV_DEPS))"`

install-git-hooks: ## Install GIT pre-commit hook.
ln -sf ../../scripts/internal/git_pre_commit.py .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

# ===================================================================
# Tests
# ===================================================================

test: ## Run all tests. To run a specific test: do "make test ARGS=pyftpdlib.test.test_functional.TestFtpStoreData"
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS)

test-parallel: ## Run all tests in parallel.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) -n auto --dist loadgroup $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) -n auto --dist loadgroup $(ARGS)

test-functional: ## Run functional FTP tests.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_functional.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_functional.py

test-functional-ssl: ## Run functional FTPS tests.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_functional_ssl.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_functional_ssl.py

test-servers: ## Run tests for FTPServer and its subclasses.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_servers.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_servers.py

test-authorizers: ## Run tests for authorizers.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_authorizers.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_authorizers.py

test-filesystems: ## Run filesystem tests.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_filesystems.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_filesystems.py

test-ioloop: ## Run IOLoop tests.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_ioloop.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_ioloop.py

test-cli: ## Run miscellaneous tests.
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_cli.py
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) $(ARGS) pyftpdlib/test/test_cli.py

test-lastfailed: ## Run previously failed tests
$(TEST_PREFIX) $(PYTHON) -m pytest $(PYTEST_ARGS) --last-failed $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m pytest $(PYTEST_ARGS) --last-failed $(ARGS)

test-coverage: ## Run test coverage.
rm -rf .coverage htmlcov
$(TEST_PREFIX) $(PYTHON) -m coverage run -m pytest $(PYTEST_ARGS) $(ARGS)
$(PYTHON_ENV_VARS) $(PYTHON) -m coverage run -m pytest $(PYTEST_ARGS) $(ARGS)
$(PYTHON) -m coverage report
@echo "writing results to htmlcov/index.html"
$(PYTHON) -m coverage html
Expand Down Expand Up @@ -167,50 +171,51 @@ fix-all: ## Run all code fixers.
# Distribution
# ===================================================================

check-manifest: ## Inspect MANIFEST.in file.
$(PYTHON) -m check_manifest -v $(ARGS)

upload-src: ## Upload source on PYPI.
${MAKE} clean
$(PYTHON) setup.py sdist upload

git-tag-release: ## Git-tag a new release.
git tag -a release-`python3 -c "import setup; print(setup.VERSION)"` -m `git rev-list HEAD --count`:`git rev-parse --short HEAD`
git push --follow-tags

install-git-hooks: ## Install GIT pre-commit hook.
ln -sf ../../scripts/internal/git_pre_commit.py .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

grep-todos: ## Look for TODOs in source files.
git grep -EIn "TODO|FIXME|XXX"
sdist: ## Create tar.gz source distribution.
${MAKE} generate-manifest
$(PYTHON_ENV_VARS) $(PYTHON) setup.py sdist
# Check sanity of source distribution.
$(PYTHON_ENV_VARS) $(PYTHON) -m virtualenv --clear --no-wheel --quiet build/venv
$(PYTHON_ENV_VARS) build/venv/bin/python -m pip install -v --isolated --quiet dist/*.tar.gz
$(PYTHON_ENV_VARS) build/venv/bin/python -c "import os; os.chdir('build/venv'); import pyftpdlib"
$(PYTHON) -m twine check --strict dist/*.tar.gz

pre-release: ## All the necessary steps before making a release.
${MAKE} clean
${MAKE} sdist
$(PYTHON) -c \
"from pyftpdlib import __ver__ as ver; \
doc = open('docs/index.rst').read(); \
history = open('HISTORY.rst').read(); \
assert ver in history, '%r not in HISTORY.rst' % ver; \
assert 'XXXX' not in history; \
"
$(PYTHON) setup.py sdist

release: ## Creates a release (tar.gz + upload + git tag release).
${MAKE} pre-release
$(PYTHON) -m twine upload --verbose dist/* # upload tar on PYPI
$(PYTHON) -m twine upload dist/*.tar.gz # upload tar on PYPI
${MAKE} git-tag-release

generate-manifest: ## Generates MANIFEST.in file.
$(PYTHON) scripts/internal/generate_manifest.py > MANIFEST.in

git-tag-release: ## Git-tag a new release.
git tag -a release-`python3 -c "import setup; print(setup.VERSION)"` -m `git rev-list HEAD --count`:`git rev-parse --short HEAD`
git push --follow-tags

print-announce: ## Print announce of new release.
@$(PYTHON) scripts/internal/print_announce.py

# ===================================================================
# Misc
# ===================================================================

grep-todos: ## Look for TODOs in source files.
git grep -EIn "TODO|FIXME|XXX"

check-manifest: ## Inspect MANIFEST.in file.
$(PYTHON) -m check_manifest -v $(ARGS)

check-broken-links: ## Look for broken links in source files.
git ls-files | xargs $(PYTHON) -Wa scripts/internal/check_broken_links.py

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Features

- Extremely **lightweight**, **fast** and **scalable** (see
`why <https://github.com/giampaolo/pyftpdlib/issues/203>`__ and
`benchmarks`__).
`benchmarks`_).
- Uses **sendfile(2)** (see `pysendfile <https://github.com/giampaolo/pysendfile>`__)
system call for uploads (Linux only).
- Uses ``epoll()`` / ``kqueue()`` / ``select()`` to handle concurrency
Expand Down
2 changes: 1 addition & 1 deletion pyftpdlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ class used to interact with the file system, providing a high level,
"""


__ver__ = '2.1.0'
__ver__ = '2.0.1'
__author__ = "Giampaolo Rodola' <g.rodola@gmail.com>"
__web__ = 'https://github.com/giampaolo/pyftpdlib/'
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def main():
version=get_version(),
description='Very fast asynchronous FTP server library',
long_description=long_description,
long_description_content_type="text/x-rst",
license='MIT',
platforms='Platform Independent',
author="Giampaolo Rodola'",
Expand Down

0 comments on commit f155ab7

Please sign in to comment.